Driver Code
root = createNode ( 1 ) NEW_LINE root . l = createNode ( 2 ) NEW_LINE root . r = createNode ( 3 ) NEW_LINE root . l . l = createNode ( 4 ) NEW_LINE root . l . r = createNode ( 5 ) NEW_LINE root . r . l = createNode ( 6 ) NEW_LINE root . r . r = createNode ( 7 ) NEW_LINE sumOfNodesAtMaxDepth ( root , 0 ) NEW_LINE print ( sum [ 0 ] ) NEW_LINE