public BTPosition<T> lowestCommonAncestor(Position<T> root, T a, T b)
			throws InvalidPositionException {

		BTPosition<T> BTroot = checkPosition(root);
		while (BTroot != null) {

			T currentV = BTroot.element();
			if (comp.compare(currentV, a) > 1 && comp.compare(currentV, b) > 1) {
				BTroot = BTroot.getLeft();
			} else if (comp.compare(currentV, a) < 1
					&& comp.compare(currentV, b) < 1) {
				BTroot = BTroot.getRight();
			} else
				// this case include one of a or b is the ancestor
				return BTroot;
		}

		return null;// root is null, empty tree

	}