MCPcopy Index your code
hub / github.com/apache/groovy / bottomUpTree

Method bottomUpTree

benchmark/bench/binarytrees.java:46–57  ·  view source on GitHub ↗
(int item, int depth)

Source from the content-addressed store, hash-verified

44 }
45
46 private static TreeNode bottomUpTree(int item, int depth){
47 if (depth>0){
48 return new TreeNode(
49 bottomUpTree(2*item-1, depth-1)
50 , bottomUpTree(2*item, depth-1)
51 , item
52 );
53 }
54 else {
55 return new TreeNode(item);
56 }
57 }
58
59 TreeNode(TreeNode left, TreeNode right, int item){
60 this.left = left;

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected