package Driver;

import com.tree.nodes.Node;
import com.tree.search.binary.BST;

public class Driver {

	public static void main(String[] args) {
		
		BST<Integer> binarySearchTree = new BST<Integer>();
		binarySearchTree.insert(10);
		binarySearchTree.insert(0);
		binarySearchTree.insert(1);
		binarySearchTree.insert(115);
		binarySearchTree.insert(112);
		binarySearchTree.insert(10);
		binarySearchTree.insert(10);
		
		binarySearchTree.display(binarySearchTree.getRoot());
		System.out.println();
		binarySearchTree.delete(10);
		binarySearchTree.display(binarySearchTree.getRoot());
		System.out.println();
		binarySearchTree.delete(0);
		binarySearchTree.display(binarySearchTree.getRoot());
		System.out.println();
		binarySearchTree.delete(115);
		binarySearchTree.display(binarySearchTree.getRoot());
		System.out.println();
		binarySearchTree.delete(112);
		binarySearchTree.display(binarySearchTree.getRoot());
		System.out.println();
		binarySearchTree.delete(1);
		binarySearchTree.display(binarySearchTree.getRoot());
		System.out.println();
		System.out.println(IsValidBST(binarySearchTree.getRoot(), Integer.MIN_VALUE, Integer.MAX_VALUE));
	}
	
	/** Test function **/
	public static Boolean IsValidBST(Node<Integer> node, int MIN, int MAX) 
	{
	     if(node == (null))
	         return true;
	     if(node.getData().compareTo(MIN) > 0
	         && node.getData().compareTo(MAX) < 0
	         && IsValidBST(node.getLeft(), MIN, node.getData().getT())
	         && IsValidBST(node.getRight(), node.getData().getT(), MAX))
	         return true;
	     else 
	         return false;
	}

}

@@ -71,16 +71,17 @@
 .binary.
+B
 BST;%0D%0A%0D%0A
@@ -154,16 +154,17 @@
 %0D%0A%09%09%0D%0A%09%09
+B
 BST%3CInte
@@ -191,16 +191,17 @@
 e = new 
+B
 BST%3CInte
@@ -267,16 +267,17 @@
 .insert(
+2
 0);%0D%0A%09%09b
@@ -299,17 +299,18 @@
 .insert(
-1
+30
 );%0D%0A%09%09bi
@@ -331,19 +331,18 @@
 .insert(
-115
+40
 );%0D%0A%09%09bi
@@ -363,19 +363,18 @@
 .insert(
-112
+50
 );%0D%0A%09%09bi
@@ -387,34 +387,34 @@
 archTree.insert(
-10
+25
 );%0D%0A%09%09binarySear
@@ -433,20 +433,16 @@
 t(10);%0D%0A
-%09%09%0D%0A
 %09%09binary
@@ -464,61 +464,12 @@
 lay(
-binarySearchTree.getRoot());%0D%0A%09%09System.out.println(
 );
+%0D%0A
 %0D%0A%09%09
@@ -529,59 +529,8 @@
 lay(
-binarySearchTree.getRoot());%0D%0A%09%09System.out.println(
 );%0D%0A
@@ -555,16 +555,17 @@
 .delete(
+3
 0);%0D%0A%09%09b
@@ -592,59 +592,8 @@
 lay(
-binarySearchTree.getRoot());%0D%0A%09%09System.out.println(
 );%0D%0A
@@ -622,11 +622,10 @@
 ete(
-11
 5
+0
 );%0D%0A
@@ -655,59 +655,8 @@
 lay(
-binarySearchTree.getRoot());%0D%0A%09%09System.out.println(
 );%0D%0A
@@ -685,11 +685,10 @@
 ete(
-11
 2
+0
 );%0D%0A
@@ -706,32 +706,38 @@
 rchTree.display(
+);%0D%0A%09%09
 binarySearchTree
@@ -741,42 +741,17 @@
 ree.
-getRoot());%0D%0A%09%09System.out.println(
+delete(25
 );%0D%0A
@@ -770,23 +770,23 @@
 chTree.d
-elete(1
+isplay(
 );%0D%0A%09%09bi
@@ -801,23 +801,30 @@
 chTree.d
-isplay(
+elete(40);%0D%0A%09%09
 binarySe
@@ -836,41 +836,15 @@
 ree.
-getRoot());%0D%0A%09%09System.out.println
+display
 ();%0D

Update Driver.java