Driver code
int main ( ) { node * root = newNode ( 6 ) ; root -> left = newNode ( 3 ) ; root -> right = newNode ( 5 ) ; root -> left -> left = newNode ( 2 ) ; root -> left -> right = newNode ( 5 ) ; root -> right -> right = newNode ( 4 ) ; root -> left -> right -> left = newNode ( 7 ) ; root -> left -> right -> right = newNode ( 4 ) ; cout << " Sum ▁ of ▁ all ▁ paths ▁ is ▁ " << treePathsSum ( root ) ; return 0 ; }