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

Method main

java/Chapter 4/Question4_7/QuestionC.java:54–65  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

52 }
53
54 public static void main(String[] args) {
55 int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
56 TreeNode root = TreeNode.createMinimalBST(array);
57 TreeNode n3 = root.find(10);
58 TreeNode n7 = root.find(6);
59 TreeNode ancestor = commonAncestor(root, n3, n7);
60 if (ancestor != null) {
61 System.out.println(ancestor.data);
62 } else {
63 System.out.println("null");
64 }
65 }
66
67}

Callers

nothing calls this directly

Calls 3

createMinimalBSTMethod · 0.95
findMethod · 0.95
commonAncestorMethod · 0.95

Tested by

no test coverage detected