Example: 1 / \ 2 3 / \ / \ 4 5 6 7 / 8 ==> sum of all nodes = 36 (1+2+3+4+5+6+7+8)
1. If root is null return 0
root
null
0
2. Else return root.data + sum(root.left) + sum(root.right))
root.data + sum(root.left) + sum(root.right))
public int sum(TreeNode root) { }