Package org.jheaps

Interface DoubleEndedHeap<K>

  • Type Parameters:
    K - the type of keys maintained by this heap
    All Superinterfaces:
    Heap<K>
    All Known Subinterfaces:
    DoubleEndedValueHeap<K,​V>
    All Known Implementing Classes:
    MinMaxBinaryArrayDoubleEndedHeap

    public interface DoubleEndedHeap<K>
    extends Heap<K>
    A double-ended heap.
    Author:
    Dimitrios Michail
    • Method Detail

      • findMax

        K findMax()
        Find an element with the maximum key.
        Returns:
        an element with the maximum key
        Throws:
        NoSuchElementException - if the heap is empty
      • deleteMax

        K deleteMax()
        Delete and return an element with the maximum key. If multiple such elements exists, only one of them will be deleted.
        Returns:
        the deleted element with the maximum key
        Throws:
        NoSuchElementException - if the heap is empty