Snap interview question

write a function to return the kth largest element in a binary search tree

Interview Answer

Anonymous

22 Aug 2017

Perform inverted in-order traversal (mark right child, then current node, then left child recursively) and mark k nodes. Last node marked is kth largest element