Further if there are parent pointers defined in the BST, I think the
approach takes O(1) space because, we greedily traverse the tree with 2
pointers.
(Of course the space needed for tree is excluded).

On Sat, Mar 9, 2013 at 9:46 AM, marti <[email protected]> wrote:

> Thank you!!!  Sir.
>
>
> On Tuesday, March 5, 2013 1:24:30 PM UTC+5:30, marti wrote:
>>
>> Given a value , print two nodes that sum to the value in a BST and normal
>> tree.. time:O(n), space O(logn).
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
 -    Saurabh Paliwal

       B-Tech. Comp. Science and Engg.

       IIT ROORKEE

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to