How to print the kth smallest element in Binary search tree without
using any static/global variable. You can’t pass the value k to any
function also.

What comes to my mind is:
Have an array which will contain the inorder traversal of binary
search tree. Let the user input k and return kth element in array.

Any non-trivial approach?

--

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