public void insert(E e)
    {
        int newPlace = heapSize;
        while (newPlace > 0 &&
                comparator.compare(e, array[getParent(newPlace)]) < 0)
        {
            array[newPlace] = array[getParent(newPlace)];
            if (indexes != null)
                indexes.put((E)array[newPlace], newPlace);
            newPlace = getParent(newPlace);
        }
        array[newPlace] = e;
        if (indexes != null)
            indexes.put(e, newPlace);
        heapSize++;
        if (heapSize >= array.length)
            increaseArray();
    }