Check this http://ideone.com/o8gF2
On Wed, Jun 29, 2011 at 10:28 PM, Swathi <chukka.swa...@gmail.com> wrote: > This should be very simple... follow inorder.. > > Inorder(Node* node, int counter, int N) > { > if(node == null)return; > Inorder(node->left, counter, N); > counter++; > if(counter == N) > { > print(node->data); > return; > } > Inorder(node->right, counter, N); > > } > > > On Wed, Jun 29, 2011 at 9:03 PM, piyush kapoor <pkjee2...@gmail.com>wrote: > >> Order Statistics Tree >> >> >> On Wed, Jun 29, 2011 at 8:15 PM, sunny agrawal >> <sunny816.i...@gmail.com>wrote: >> >>> At each node if we store the Number of nodes in the left subtree.....we >>> can find kth smallest in O(lgn) >>> else do a inorder traversal for k nodes >>> >>> On Wed, Jun 29, 2011 at 8:07 PM, Nishant Mittal < >>> mittal.nishan...@gmail.com> wrote: >>> >>>> how to find kth smallest element in BST... >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@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. >>>> >>>> >>> >>> >>> -- >>> Sunny Aggrawal >>> B-Tech IV year,CSI >>> Indian Institute Of Technology,Roorkee >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@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. >>> >> >> >> >> -- >> *Regards,* >> *Piyush Kapoor,* >> *CSE-IT-BHU* >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@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. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@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. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@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.