leetcode

222. Count Complete Tree Nodes

Solution code: O(log(n)^2)

Time complexity: O(log(n)^2)

h = height of tree

Space complexity: O(h)

Solution code: O(n)

Time complexity: O(n)

h = height of tree

Space complexity: O(h)