Template Class LinkedHeapPriorityQueue

Nested Relationships

Nested Types

Class Documentation

template<class T, std::totally_ordered P = int, bool L = false>
class LinkedHeapPriorityQueue

a priority queue on a heap with pointers

Public Types

using Item = T

the type of the items

using Priority = P

the type of the priorities

using value_type = std::pair<const P&, const T&>
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using reference = value_type
using const_reference = value_type
using const_iterator = PathIterator<LinkedHeapPriorityQueue, Shape>
using iterator = const_iterator

Public Functions

LinkedHeapPriorityQueue(void) = default
LinkedHeapPriorityQueue(const LinkedHeapPriorityQueue&) = delete
LinkedHeapPriorityQueue &operator=(const LinkedHeapPriorityQueue&) = delete
LinkedHeapPriorityQueue(LinkedHeapPriorityQueue &&other) noexcept

the items of other, which is left empty

LinkedHeapPriorityQueue &operator=(LinkedHeapPriorityQueue &&other) noexcept
~LinkedHeapPriorityQueue()
bool empty(void) const
int size(void) const
const T &min(void) const
Pre:

the queue is not empty

const P &minPriority(void) const
Pre:

the queue is not empty

void insert(const T &x, const P &p)

a new last leaf, moved up while smaller than its parent

Post:

one item more

T deleteMin(void)

the last leaf into the root, moved down while larger than a child

Pre:

the queue is not empty

Post:

one item less, none of smaller priority than the one removed

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

the shape of the tree, for PathIterator

Public Static Functions

static inline auto root(const auto &o)
static inline auto left(const auto *n)
static inline auto right(const auto *n)
static inline auto read(const auto *n)