juver++, If we do inorder traversal (right_child -- >> parent -- >> left_child) and output kth element then we are done. I didn't understand the 2nd point, why we need to modify the bst (store child count at each node). Am I missing anything here? Please advise.
On Jan 12, 12:04 am, juver++ <[email protected]> wrote: > 1. Make inorder traversal and output k-th element. > 2. Store in each node additional variable - amount of nodes in the subtree > rooted at node. Process the query in O(height) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
