private int height(Node<T> currentNode) {
        if (currentNode == null) {
            return 0;
        }
        int maxWidth = 1;
        int width = 1;
        Node<T> tNode = currentNode;
        Set<T> observedNodes = new HashSet<T>();
        while (tNode != currentNode.getParent()) {
            observedNodes.add(tNode.getData());
            if (tNode.getLeftChild() != null && !observedNodes.contains(tNode.getLeftChild().getData())) {
                width++;
                if (width > maxWidth) {
                    maxWidth = width;
                }
                tNode = tNode.getLeftChild();
            } else if (tNode.getRightChild() != null && !observedNodes.contains(tNode.getRightChild().getData())) {
                width++;
                if (width > maxWidth) {
                    maxWidth = width;
                }
                tNode = tNode.getRightChild();
            } else {
                width--;
                tNode = tNode.getParent();
            }
        }
        return maxWidth;
    }