MCPcopy Create free account
hub / github.com/careercup/ctci / main

Method main

java/Chapter 4/Question4_7/Question.java:45–52  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

43 }
44
45 public static void main(String[] args) {
46 int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
47 TreeNode root = TreeNode.createMinimalBST(array);
48 TreeNode n3 = root.find(1);
49 TreeNode n7 = root.find(7);
50 TreeNode ancestor = commonAncestor(root, n3, n7);
51 System.out.println(ancestor.data);
52 }
53
54}

Callers

nothing calls this directly

Calls 3

createMinimalBSTMethod · 0.95
findMethod · 0.95
commonAncestorMethod · 0.95

Tested by

no test coverage detected