(String args[])
| 34 | preorder(root.right); |
| 35 | } |
| 36 | public static void main(String args[]) { |
| 37 | /* |
| 38 | 1 |
| 39 | / \ |
| 40 | 2 3 |
| 41 | / \ / \ |
| 42 | 4 5 6 7 |
| 43 | |
| 44 | expected sum tree is : |
| 45 | |
| 46 | 27 |
| 47 | / \ |
| 48 | 9 13 |
| 49 | / \ / \ |
| 50 | 0 0 0 0 |
| 51 | */ |
| 52 | Node root = new Node(1); |
| 53 | root.left = new Node(2); |
| 54 | root.right = new Node(3); |
| 55 | root.left.left = new Node(4); |
| 56 | root.left.right = new Node(5); |
| 57 | root.right.left = new Node(6); |
| 58 | root.right.right = new Node(7); |
| 59 | |
| 60 | convertToSumTree(root); |
| 61 | preorder(root); |
| 62 | } |
| 63 | } |
nothing calls this directly
no test coverage detected