Given a limited sequnce of numbers, we create an unbalanced binary search tree, and each node has a depth. Find out the depth of a given node without creating the tree.

The running complexity should be O(n) at most.

2019/02/01 17:24:44

Given a limited sequnce of numbers, we create an unbalanced binary search tree, and each node has a depth. Find out the depth of a given node without creating the tree.

The running complexity should be O(n) at most.