Re: [algogeeks] Tree - sum problem

2012-11-17 Thread atul anand
from each node , make 4 recursive call 1) you consider this node as part of the solution i.e left=target - currentNode->data is passed , and consider current->left for next recursion 2)you consider this node as part of the solution i.e left=target - currentNode->data is passed , and consider curren

[algogeeks] Tree - sum problem

2012-11-17 Thread Amitesh Singh
Given a binary search tree and a target value, find all the paths (if there exists more than one) which sum up to the target value. It can be any path in the tree. It doesn't have to be from the root. -- Amitesh --