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

Method main

java/Chapter 4/Question4_1/QuestionImproved.java:36–47  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

34 }
35
36 public static void main(String[] args) {
37 // Create balanced tree
38 int[] array = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10};
39 TreeNode root = TreeNode.createMinimalBST(array);
40
41
42 System.out.println("Is balanced? " + isBalanced(root));
43
44 root.insertInOrder(4); // Add 4 to make it unbalanced
45
46 System.out.println("Is balanced? " + isBalanced(root));
47 }
48
49}

Callers

nothing calls this directly

Calls 3

createMinimalBSTMethod · 0.95
isBalancedMethod · 0.95
insertInOrderMethod · 0.95

Tested by

no test coverage detected