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

Method main

java/Chapter 4/Question4_7/QuestionCBad.java:33–44  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

31 }
32
33 public static void main(String[] args) {
34 int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
35 TreeNode root = TreeNode.createMinimalBST(array);
36 TreeNode n3 = root.find(9);
37 TreeNode n7 = new TreeNode(6);//root.find(10);
38 TreeNode ancestor = commonAncestorBad(root, n3, n7);
39 if (ancestor != null) {
40 System.out.println(ancestor.data);
41 } else {
42 System.out.println("null");
43 }
44 }
45
46}

Callers

nothing calls this directly

Calls 3

createMinimalBSTMethod · 0.95
findMethod · 0.95
commonAncestorBadMethod · 0.95

Tested by

no test coverage detected