- A Logic Circuit Simulation Library in C++ |
#include <queue.h>
Inheritance diagram for lcs::PriorityQueue< T, Order >:
Order
. This argument can either 1. take a value lcs::ASCENDING
to indicate that lower key values have higher priority, or 2. take a value lcs::DESCENDING
to indicate that higher key values have higher priority.
This class is inherited from the class lcs::Queue
through protected inheritance. However, it supports all the member functions as in the class lcs::Queue
.
Public Member Functions | |
void | enQueue (T e, int key) |
void | removeLower (int key) |
void lcs::PriorityQueue< T, Order >::enQueue | ( | T | e, | |
int | key | |||
) |
Adds an element into the queue based on the priority indicated by the key argument.
e | The element to be added into the queue. | |
key | The key which indicates the priority. |
void lcs::PriorityQueue< T, Order >::removeLower | ( | int | key | ) |
Removes elements from the queue which have a priority equal and less than the one indicated by the key argument.
key | Elements in the queue having lesser or equal priority than that indicated by this argument will be removed from the queue. |