분류 전체보기351 [leetcode 337] House Robber III The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the police if two directly-linked houses were broken into on the same night. Determine t.. 2020. 10. 20. [알고리즘] Floyd's tortoise and hare 플로이드의 토끼와 거북이라는 귀여운 이름을 지닌 알고리즘이다. 다른 이름으론 플로이드의 순환 찾기 알고리즘으로 cycle detection에 사용된다. en.wikipedia.org/wiki/Cycle_detection Cycle detection - Wikipedia From Wikipedia, the free encyclopedia Jump to navigation Jump to search In computer science, cycle detection or cycle finding is the algorithmic problem of finding a cycle in a sequence of iterated function values. For any function f that maps a f.. 2020. 10. 20. [c c++] isdigit 함수 문자가 숫자인지 확인해주는 함수 헤더 c에선: #include c++에선: #include 함수 원형 int isdigit(char c); c가 10진수 숫자로 변경가능하면 0이 아닌 수를 리턴, 아니면 0을 리턴 2020. 10. 19. [c++] STL priority_queue 우선순위 큐 c++ STL 중 하나인 우선순위 큐에 대해 알아보자. 큐와 동일하지만 안에서 정렬이 된다는 점이 다르다. - 헤더는 #include - 선언은 priority_queue pq - 자료형은 int, double, class - 구현체는 기본적으로 vector - 비교연산자의 기본값은 less 내림차순, greater 오름차순 정렬 가능 - push/pop을 하는 경우 시간 복잡도는 logN - 자료형이 pair라면 우선적으로 a를 확인하고 a가 같으면 b에 따라 결정된다. -pq.push(input) -pq.pop() -pq.top() : front 없음. iterator없음 -pq.empty() -pq.size() #include #include #include #define pi pair int ma.. 2020. 10. 19. 이전 1 ··· 67 68 69 70 71 72 73 ··· 88 다음