Package org.jheaps

Interface AddressableHeap<K,​V>

    • Method Detail

      • comparator

        Comparator<? super K> comparator()
        Returns the comparator used to order the keys in this AddressableHeap, or null if this heap uses the natural ordering of its keys.
        Returns:
        the comparator used to order the keys in this heap, or null if this addressable heap uses the natural ordering of its keys
      • insert

        AddressableHeap.Handle<K,​V> insert​(K key,
                                                 V value)
        Insert a new element into the heap.
        Parameters:
        key - the element's key
        value - the element's value
        Returns:
        a handle for the newly added element
      • insert

        AddressableHeap.Handle<K,​V> insert​(K key)
        Insert a new element into the heap with a null value.
        Parameters:
        key - the element's key
        Returns:
        a handle for the newly added element
      • findMin

        AddressableHeap.Handle<K,​V> findMin()
        Find an element with the minimum key.
        Returns:
        a handle to an element with minimum key
      • isEmpty

        boolean isEmpty()
        Returns true if this heap is empty.
        Returns:
        true if this heap is empty, false otherwise
      • size

        long size()
        Returns the number of elements in the heap.
        Returns:
        the number of elements in the heap