Package org.drip.graph.heap
Class PriorityQueue<KEY extends java.lang.Comparable<KEY>,ITEM>
java.lang.Object
org.drip.graph.heap.PriorityQueue<KEY,ITEM>
- Direct Known Subclasses:
ApproximatePriorityQueue
,BinaryTreePriorityQueue
,BinomialTreePriorityQueue
,KaplanZwickPriorityQueue
public abstract class PriorityQueue<KEY extends java.lang.Comparable<KEY>,ITEM>
extends java.lang.Object
PriorityQueue exposes the Stubs of a Priority Queue's Operations. The References are:
- Brodal, G. S. (1996): Priority Queue on Parallel Machines Scandinavian Workshop on Algorithm Theory – SWAT ’96 416-427
- Cormen, T., C. E. Leiserson, R. Rivest, and C. Stein (2009): Introduction to Algorithms 3rd Edition MIT Press
- Sanders, P., K. Mehlhorn, M. Dietzfelbinger, and R. Dementiev (2019): Sequential and Parallel Algorithms and Data Structures – A Basic Toolbox Springer
- Sundell, H., and P. Tsigas (2005): Fast and Lock-free Concurrent Priority Queues for Multi-threaded Systems Journal of Parallel and Distributed Computing 65 (5) 609-627
- Wikipedia (2020): Priority Queue https://en.wikipedia.org/wiki/Priority_queue
- Module = Computational Core Module
- Library = Graph Algorithm Library
- Project = Graph Optimization and Tree Construction Algorithms
- Package = Heap Based Priority Queue Implementations
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description PriorityQueue(boolean minHeap)
PriorityQueue Constructor -
Method Summary
Modifier and Type Method Description boolean
delete(KEY key)
Delete the Entry corresponding to the specified Keyabstract PriorityQueueEntry<KEY,ITEM>
extractExtremum()
Extract the Top from the Heapabstract PriorityQueueEntry<KEY,ITEM>
extremum()
Retrieve the Top from the Heapabstract boolean
insert(KEY key, ITEM item)
Insert the Specified Key/Item into the Heapabstract boolean
isEmpty()
Indicate if the Heap is Emptyabstract boolean
meld(PriorityQueue<KEY,ITEM> priorityQueueOther)
Meld the Specified Priority Queue with the Currentboolean
minHeap()
Indicate if the Binary Heap is a Min Heapjava.util.List<PriorityQueueEntry<KEY,ITEM>>
sortedEntryList()
Generate the Sorted Entry Listjava.util.List<ITEM>
sortedItemList()
Generate the Sorted Item Listjava.util.List<KEY>
sortedKeyList()
Generate the Sorted Key ListMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PriorityQueue
public PriorityQueue(boolean minHeap)PriorityQueue Constructor- Parameters:
minHeap
- TRUE - Indicates that Heap is a Min Heap
-
-
Method Details
-
minHeap
public boolean minHeap()Indicate if the Binary Heap is a Min Heap- Returns:
- TRUE - The Binary Heap is a Min Heap
-
insert
Insert the Specified Key/Item into the Heap- Parameters:
key
- Keyitem
- Node Item- Returns:
- TRUE - The Key/Item successfully inserted
-
meld
Meld the Specified Priority Queue with the Current- Parameters:
priorityQueueOther
- The Specified Binary Tree Priority Queue- Returns:
- TRUE - The Specified Priority Queue successfully melded
-
extremum
Retrieve the Top from the Heap- Returns:
- The Top Key in the Heap
-
extractExtremum
Extract the Top from the Heap- Returns:
- The Top Key in the Heap
-
isEmpty
public abstract boolean isEmpty()Indicate if the Heap is Empty- Returns:
- TRUE - The Heap is Empty
-
delete
Delete the Entry corresponding to the specified Key- Parameters:
key
- Key- Returns:
- TRUE - The corresponding Entry successfully deleted
-
sortedKeyList
Generate the Sorted Key List- Returns:
- The Sorted Key List
-
sortedEntryList
Generate the Sorted Entry List- Returns:
- The Sorted Entry List
-
sortedItemList
Generate the Sorted Item List- Returns:
- The Sorted Item List
-