public static Node treeInsert(Node root,int key){
		Node y =null;
		Node z = new Node(key);
		Node x = root;
		while(x != null){
			y = x;
			if(x.key > z.key)
				x = x.left;
			else
				x = x.right;
		}
		
		z.p = y;
		if(y == null){
			root  = z;
		}
		else if(z.key <y.key){
			y.left = z;
		}
		else 
			y.right = z;
		return root;
	}