Class HeapAdaptablePriorityQueue<K,V>

java.lang.Object
com.zybooks.dsaj.pq.AbstractPriorityQueue<K,V>
com.zybooks.dsaj.pq.HeapPriorityQueue<K,V>
com.zybooks.dsaj.pq.HeapAdaptablePriorityQueue<K,V>
Type Parameters:
K - The key type (keys must be unique and comparable)
V - The value type stored with each entry
All Implemented Interfaces:
AdaptablePriorityQueue<K,V>, PriorityQueue<K,V>

public class HeapAdaptablePriorityQueue<K,V> extends HeapPriorityQueue<K,V> implements AdaptablePriorityQueue<K,V>
An implementation of an adaptable priority queue using an array-based heap.
  • Constructor Details

    • HeapAdaptablePriorityQueue

      public HeapAdaptablePriorityQueue()
      Creates an empty adaptable priority queue using natural ordering of keys.
    • HeapAdaptablePriorityQueue

      public HeapAdaptablePriorityQueue(Comparator<K> comp)
      Creates an empty adaptable priority queue using the given comparator to order keys.
      Parameters:
      comp - comparator defining the order of keys in the priority queue
  • Method Details