Tuesday 17 March 2015

JOSH: WAP that sum up all leaf nodes without globle variable

Question

WAP that sum up all leaf nodes without globle
input tree  3
           / \
         4    5
        / \    \
       6   8    9
          /
         7
Output 6+7+9=22