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 <[email protected]>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 [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.
>



-- 
*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 [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