Interface Heap

  • All Known Implementing Classes:
    BinaryHeap

    public interface Heap
    • Field Detail

      • INITIAL_CAPACITY

        static final int INITIAL_CAPACITY
        The initial capacity of the heap.
        See Also:
        Constant Field Values
    • Method Detail

      • isEmpty

        boolean isEmpty()
        Checks if the heap is empty of not.
        Returns:
        true if the heap is empty and false if it is not
      • insert

        void insert​(Node node)
        Inserts a node into the heap.
        Parameters:
        node - node to be inserted
      • extractMin

        Node extractMin()
        Removes and returns the min node.
        Returns:
        the min node