@Test public void shouldReturnTrueIfBinaryTreeIsBSTIterative() { BinaryNode<Integer> root = new BinaryNode<Integer>(0); BinaryNode<Integer> n1 = new BinaryNode<Integer>(1); BinaryNode<Integer> n2 = new BinaryNode<Integer>(2); n1.setLeft(root); n1.setRight(n2); assertTrue(isBST.checkIterative(n1)); }
public boolean checkIterative(BinaryNode<Integer> root) { validateInput(root); List<BinaryNode<Integer>> nodesInOrder = binaryTreeInOrder.getRecursive(root); return isListOrdered(nodesInOrder); }
IsBST { public boolean checkIterative(BinaryNode<Integer> root) { validateInput(root); List<BinaryNode<Integer>> nodesInOrder = binaryTreeInOrder.getRecursive(root); return isListOrdered(nodesInOrder); } }
IsBST { public boolean checkIterative(BinaryNode<Integer> root) { validateInput(root); List<BinaryNode<Integer>> nodesInOrder = binaryTreeInOrder.getRecursive(root); return isListOrdered(nodesInOrder); }  }
IsBST { public boolean checkIterative(BinaryNode<Integer> root) { validateInput(root); List<BinaryNode<Integer>> nodesInOrder = binaryTreeInOrder.getRecursive(root); return isListOrdered(nodesInOrder); }  boolean checkRecursive(BinaryNode<Integer> root); boolean checkIterative(BinaryNode<Integer> root); }
IsBST { public boolean checkIterative(BinaryNode<Integer> root) { validateInput(root); List<BinaryNode<Integer>> nodesInOrder = binaryTreeInOrder.getRecursive(root); return isListOrdered(nodesInOrder); }  boolean checkRecursive(BinaryNode<Integer> root); boolean checkIterative(BinaryNode<Integer> root);  }