Why should we start traversing towards right ?
root will be the ultimate parent anyways . May be I din get your
approach .Can you elaborate with an example as given by the Thread
starter ?
For vertical level 1 . The node is 10 and hence the sum is 10 .
For vertical line 2 (level 2) , going left
HAD MISSED OUT SOPME THINGS IN PREVIOUS REPLY.
SORRY GUYS
hereby i rectify the mistakes:
Claim: any given vertical line will start with a node.(This is obvious)
Divide this problem into 2 subparts.
1st: Finding the starting node of given line.
2nd : finding the required sum.
Let T