230. Kth Smallest Element in a BST
Solutions - In-order Traversal
- A helper function to traverse the tree in order. The function will be popped up from the stack, and thus its result is reversed.
count--
for each ‘root’ node.- When
count == 0
, we have found the result.