Congrats to Ravi Ranjan.
But note you can figure out what's on the recursion stack at any time
(for example in a graph search) by adopting a different coding style.
Here is a simple example.
// binary tree nodes
typedef struct node {
struct node *left, *right;
int key;
};
// search stack fra
agreed with u~~
On 3月1日, 下午12时06分, atul anand wrote:
> didnt get this question :-
>
> *minimum separation distance between two nodes of tree *
> minimum sepration on what basis , is it similar to Dijkstra algo ???
>
> On Wed, Feb 29, 2012 at 11:35 PM, Ravi Ranjan wrote:
>
>
>
>
>
>
>
> > @all
>
>
@atul
thanx dude..
yeah it is the soln...
i think in interview i quite tired thats why unable to think in this simle
way...
again thanx a lot atul and all other GEEKS :) :)
--
You received this message because you are subscribed to the Google Groups
"Algorithm
@Ravi : yeah dere is..and it was discussed before on this group..
check out this link :-
check soln by Lucifier..
http://groups.google.com/group/algogeeks/browse_thread/thread/9bbdd33a6b1e1c5f/fab5d6ad3840b74d?hl=en&lnk=gst&q=Find+the+path+in+two+nodes+of+a+binary+search+tree#fab5d6ad3840b74d
O
@atul
two nodes were given in the qstn...
i did
1) calculate the level of one node through level order traversal similarly
for other
2) then find the Least Common Anscestor
3) then dist(LCS - node1) + dist(LCS - node2)
but i think this was not optimized bcse he was not very much satisfied b
congrats :)
On Feb 29, 8:28 pm, Umer Farooq wrote:
> congratz dude! :-)
>
> And best of luck with your future endeavours.
>
> On Wed, Feb 29, 2012 at 11:05 PM, Ravi Ranjan wrote:
>
>
>
>
>
>
>
>
>
> > @all
>
> > 3 round liye
>
> > 1.5 hours each only data structure n algorithm n 2 qstns from OS