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

Method main

java/Chapter 4/Question4_6/Question.java:35–47  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

33 }
34
35 public static void main(String[] args) {
36 int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
37 TreeNode root = TreeNode.createMinimalBST(array);
38 for (int i = 0; i < array.length; i++) {
39 TreeNode node = root.find(array[i]);
40 TreeNode next = inorderSucc(node);
41 if (next != null) {
42 System.out.println(node.data + "->" + next.data);
43 } else {
44 System.out.println(node.data + "->" + null);
45 }
46 }
47 }
48
49}

Callers

nothing calls this directly

Calls 3

createMinimalBSTMethod · 0.95
findMethod · 0.95
inorderSuccMethod · 0.95

Tested by

no test coverage detected