there is something called morris inorder traversal. credits to donald knuth
On 5/15/10, kaushik sur <kaushik....@gmail.com> wrote: > Hi Friends > > I have encountered the question in sites - "Given a Binary Search > Tree, write a program to print the kth smallest element without using > any static/global variable. You can't pass the value k to any function > also." > > I have tried my hands using explicit stack for inorder and keeping a > non-static count variable. > > I welcome any better solution, time and space efficient. > > Best Regards > Kaushik Sur > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- -------------------------------------------------- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.