Write a recursive function that will store each root to leaf path in an array. Now for each root to leaf path find the subarray which sums up to X.
On Thu, Nov 10, 2011 at 11:53 PM, AMAN AGARWAL <[email protected]> wrote: > Hi All, > > Please give me the solution of this problem. > > A binary tree and a number X is given. Find all the paths(not necessarily > starting from root) such that the sum equals X. > > > Regards, > Aman. > > -- > AMAN AGARWAL > "Success is not final, Failure is not fatal: It is the courage to continue > that counts!" > > -- > 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. > -- 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.
