private int height(final int index) {

        // Left and right children indices
        int leftChildIndex = getLeftChildIndex(index);
        int rightChildIndex = getRightChildIndex(index);

        boolean childIsNull_l = (array.getElement(leftChildIndex) == null);
        boolean childIsNull_r = (array.getElement(rightChildIndex) == null);

        if (index < array.getSize() && array.getElement(index) == null) {
            // The index is valid but the node is null
            return 0;
        }

        if (array.getSize() <= 2 * index || (childIsNull_l && childIsNull_r)) {
            // The current node's children do not exist
            return 1; // or 0?
        }

        if (childIsNull_l) { // No left (lesser) child
            return 1 + height(rightChildIndex);
        }

        if (childIsNull_r) { // No right (bigger) child
            return 1 + height(leftChildIndex);
        }

        return 1 + Math.max(height(leftChildIndex), height(rightChildIndex));
    }