Move to right, add right if possible. 注意stack.pop()在加完left-most child 的后,一定要curr = curr.right. stack: add left till end; consume top, if has right, add right; push right.left till end of right's left ...
2. Only calculate depth using maxDepth function. Same concept as in 1, but cost more traversal efforts. Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced ...