public int treeHeight2(BTPosition<T> current)
			throws InvalidPositionException {

		if (current == null)
			return 0;
		Stack<BTPosition<T>> s = new Stack<>();
		int max = 0;
		int count = 0;
		while (!s.isEmpty() || current != null) {
			if (current != null) {
				s.push(current);
				count++;
				current = current.getLeft();
			} else {// key point, every time null,calculate height
				current = s.peek();
				if (current.getRight() == null) {
					max = Math.max(max, s.size());
					current = s.pop();
				}
				current = current.getRight();
			}
		}
		return max;
	}