Template Class TreePriorityQueue

Class Documentation

template<class T, std::totally_ordered P = int>
class TreePriorityQueue

a priority queue on a Red-Black tree

Public Types

using Item = T

the type of the items

using Priority = P

the type of the priorities

using Handle = long

the number of insertion of an item

using value_type = typename RedBlackTree<Key, T>::value_type
using const_iterator = typename RedBlackTree<Key, T>::const_iterator
using iterator = const_iterator

Public Functions

bool empty(void) const
int size(void) const
const T &min(void) const
Pre:

the queue is not empty

T deleteMin(void)
Pre:

the queue is not empty

Post:

one item less

Handle insert(const T &x, const P &p)
Post:

one item more

void decrease(Handle y, const P &p)
Pre:

y is an item still in the queue and p is not larger than its priority

inline const_iterator begin(void) const
inline const_iterator end(void) const
inline const_iterator cbegin(void) const
inline const_iterator cend(void) const