do it iteratively either by:

1) If size of left tree is less than k, rotate the tree left. and so on till
.....single while loop required for this.
or
2) Start from head, if k is more than size of left-tree, go to left and
continue searching.. other wise go right and search for k-size(left)-1 in
right tree. All this can be implemented in a single while loop.

--

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.


Reply via email to