A problem on the tree.(DFS,tree,Recursion)

Revision en1, by wish_me, 2017-09-01 07:34:06

A binary tree and a number, say k are given. Print every path in the tree with sum of the nodes in the path as k. (A path can start from any node and end at any node, i.e. they need not be root node and leaf node; and negative numbers can also be there in the tree)

Tags recursion, binary tree, #dfs

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English wish_me 2017-09-01 07:34:06 311 Initial revision (published)