(TreeNode node)
| 29 | } |
| 30 | |
| 31 | public static int depth(TreeNode node) { |
| 32 | if (node == null) { |
| 33 | return 0; |
| 34 | } else { |
| 35 | return 1 + Math.max(depth(node.left), depth(node.right)); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | public static void findSum(TreeNode node, int sum) { |
| 40 | int depth = depth(node); |