public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {
		if (root == null) {
			return null;
		}

		if (root == q || root == p) {
			return root;
		}

		boolean isLeftQ = isIn(root.left, p);
		boolean isLeftP = isIn(root.left, q);
		if (isLeftP && isLeftQ) {
			return lowestCommonAncestor(root.left, p, q);
		} else if (!isLeftP && !isLeftQ) {
			return lowestCommonAncestor(root.right, p, q);
		} else {
			return root;
		}
	}