@Test void testHeight() { assertThat(BinaryTreeUtil.height(ROOT)).isEqualTo(4); }
public static int height(IntegerNode root) { if (root == null) { return 0; } return Math.max(height(root.left()), height(root.right())) + 1; }
BinaryTreeUtil { public static int height(IntegerNode root) { if (root == null) { return 0; } return Math.max(height(root.left()), height(root.right())) + 1; } }
BinaryTreeUtil { public static int height(IntegerNode root) { if (root == null) { return 0; } return Math.max(height(root.left()), height(root.right())) + 1; } private  BinaryTreeUtil(); }
BinaryTreeUtil { public static int height(IntegerNode root) { if (root == null) { return 0; } return Math.max(height(root.left()), height(root.right())) + 1; } private  BinaryTreeUtil(); static int height(IntegerNode root); static boolean isBST(ParentAwareIntegerNode root); static boolean isSame(IntegerNode root1, IntegerNode root2); static IntegerNode lowestCommonAncestor(IntegerNode root, int value1, int value2); }
BinaryTreeUtil { public static int height(IntegerNode root) { if (root == null) { return 0; } return Math.max(height(root.left()), height(root.right())) + 1; } private  BinaryTreeUtil(); static int height(IntegerNode root); static boolean isBST(ParentAwareIntegerNode root); static boolean isSame(IntegerNode root1, IntegerNode root2); static IntegerNode lowestCommonAncestor(IntegerNode root, int value1, int value2);  }