refernce
[Read More]
Time and Space Complexity of Binary Tree Inorder Traversal
Recursion
-time complexity: O(n) ( recurrrence relation: T(n) = 2*T(n/2)+1 )
-space complexity: O(h) (where h is the height of the tree)
why? At most n activation records are on the stack at one point (in the worst case)
[Read More]
LeetCode 617
LeetCode 617: Merge Two Binary Trees
[Read More]
How to speed up I/O on LeetCode?
Recently while I was reading through other’s codes on LeetCode, I encountered a few lines of code that were mysterious to me.
[Read More]
About different styles of FOR loops
There are 4 differents ways to iterate through an array.
[Read More]