private void removeBSTNode(TreeNode node, TreeNode root) {
		if (node == null) {
			return;
		}
		if (node.left == null && node.right == null) {
			TreeNode parent = findParent(node, root);
			if (node == parent.left) {
				parent.left = null;
			} else {
				parent.right = null;
			}
		} else if (node.left != null && node.right != null) {
			TreeNode nextSuccessor = getMin(node.right);
			node.val = nextSuccessor.val;
			removeBSTNode(nextSuccessor, root);
		} else if (node.left == null) {
			node.val = node.right.val;
			removeBSTNode(node.right, root);
		} else {
			node.val = node.left.val;
			removeBSTNode(node.left, root);
		}
	}