[Leetcode/Python] 222. Count Complete Tree Nodes


[Leetcode/Python] 222. Count Complete Tree Nodes

문제 링크 Count Complete Tree Nodes - 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 문제 설명 완전 이진 트리의 root가 주어지면 트리의 노드 수를 반환합니다. Wikipedia에 따르면 마지막 레벨을 제외한 모든 레벨은 완전한 이진 트리로 완전히 채워져 있으며 마지막 레벨의 모든 노드는 가능한 한 가장 왼쪽에 있습니다. 마지막 레벨 h에서 포함하여 1~2^h 노드를 가질 수 있습니다. O(n) 시간 복잡도 미만으로 실행되는 알고리즘을 ..


원문링크 : [Leetcode/Python] 222. Count Complete Tree Nodes