If we dont want the tree back, we can convert the BST to DLL and do the job.. On Mon, Jul 11, 2011 at 3:01 PM, aanchal goyal <goyal.aanch...@gmail.com>wrote:
> Given a BST and integer value K. Find all pairs of nodes (x,y), such that > x->data + y->data = K > Time O(n) > > Can someone provide a pseudocode/code to solve this using the concept of > inorder and reverse inorder traversal of BST? > PS: please don't post other solutions for this, I know this can be solved > in other ways too. I am not able to code this using the above concept.. > -- > Regards,* > Aanchal Goyal*. > > -- > 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. > -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=100000655377926 * -- 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.