Пример #1
0
 @Test
 public void testMaxDepth3() {
   TreeNode n0 = new TreeNode(0);
   TreeNode n1 = new TreeNode(1);
   n0.left = n1;
   int result = s.maxDepth(n0);
   assertTrue(result == 2);
 }
Пример #2
0
  @Test
  public void thisAlwaysPasses() {
    Solution sol = new Solution();

    TreeNode root = new TreeNode(3);

    root.left = new TreeNode(1);
    root.right = new TreeNode(5);

    root.left.right = new TreeNode(2);
    assertTrue(sol.isBalanced(root));
  }