본문 바로가기
728x90
반응형

분류 전체보기255

Swift) 프로그래머스(Lv3) - 자물쇠와 열쇠 (Simulation) programmers.co.kr/learn/courses/30/lessons/60059코딩테스트 연습 - 자물쇠와 열쇠[[0, 0, 0], [1, 0, 0], [0, 1, 1]] [[1, 1, 1], [1, 1, 0], [1, 0, 1]] trueprogrammers.co.kr안녕하세요 후르륵짭짭 입니다.오랜만에 프로그래머스 문제 해설을 하는 거 같습니다.사실 Lv3는 잘 풀지 못해서 여전히 문제 인거 같습니다...ㅠㅠ풀더라도 한번에 완벽하게 풀어야 하는데,,,,Lv3 부터는 구현도 문제 난이도도 많이 올라간 느낌을 받습니다. ** 문제 해설 **이 문제는 단순 구현 문제인 것 같습니다.처음에 이 문제를 어떻게 풀지,,, 많은 고민을 했습니다. 그래서 여러 방향을 생각하다가못해서, 결국 해설을 봤는데요... 2020. 9. 23.
Swift ) LeetCode(Medium) - Friend Circles (Union-Find) leetcode.com/problems/friend-circles/ Friend Circles - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 안녕하세요 후르륵짭짭 입니다. 오늘은 유니온 파인드 알고리즘을 들고 왔습니다. 유니온 파인드는 서로 같은 집합인지 알려주는 알고리즘인데, 사실 잘 몰라서 열심히 찾아봤습니다 ㅎㅎㅎ 그럼 바로 설명을 해보도록 하겠습니다. ** 유니온 파인드란 ** 위에서 설명한 것 처럼, 유니온 파인드는 요소가 서로 같은 집합인지 알려주.. 2020. 9. 23.
Swift ) LeetCode(Medium) - Find the City With the Smallest Number of Neighbors at a Threshold Distance (Floyd - Warshall) leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/discuss/?currentPage=1&orderBy=hot&query= Find the City With the Smallest Number of Neighbors at a Threshold Distance - LeetCode Discuss Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 안녕하세요 후르.. 2020. 9. 19.
PlayGround ) 우선순위 큐를 구현해보도록 하자!!! 안녕하세요 후르륵짭짭 입니다. 이번에는 처음으로 알고리즘 이론을 가져와 봤습니다. 모두 자료구조인 Heap에 대해서 어느정도 알고 있을 거라 생각합니다. 우선순위 큐라 불리는 Heap은 최대값 또는 최소값이 항상 루트 값에 위치 해서 빠른 시간안에 최대 값을 찾아주는 알고리즘 입니다. 그 값의 최대값? 최소값 찾는 것은 그냥 배열의 min() / max() 쓰면 되지 않냐고 생각하시는 분들 있을 수도 있습니다. 하지만 Apple Document에서는 O(n)시간을 가지게 됩니다 developer.apple.com/documentation/swift/array/1688806-max Apple Developer Documentation developer.apple.com 그러나 Heap을 쓰면 O(1)시간에.. 2020. 9. 19.
728x90
반응형