Write function that takes a binary tree and efficiently returns the Nth smallest element.
For example, if N=4, and the tree looks like:
3
/ \
2 5
/ / \
1 4 6
The function should return 4.
Write function that takes a binary tree and efficiently returns the Nth smallest element.
For example, if N=4, and the tree looks like:
3
/ \
2 5
/ / \
1 4 6
The function should return 4.