Esempio n. 1
0
 public static void main(String[] args) {
   TreeNode n1 = new TreeNode(3);
   TreeNode n2 = new TreeNode(9);
   TreeNode n3 = new TreeNode(20);
   n1.left = n2;
   n1.right = n3;
   zigzagLevelOrder2(n1);
 }
  public static void main(String[] args) {
    TreeNode root = new TreeNode(10);
    root.left = new TreeNode(5);
    root.right = new TreeNode(15);
    root.right.left = new TreeNode(6);
    root.right.right = new TreeNode(20);

    Validate_binary_search_tree vbs = new Validate_binary_search_tree();
    System.out.println(vbs.isValidBST(root)); // false
  }