MCPcopy Create free account
hub / github.com/apna-college/Alpha / main

Method main

16_BinaryTrees/SumTree.java:36–62  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 2

convertToSumTreeMethod · 0.95
preorderMethod · 0.95

Tested by

no test coverage detected