Template Class MinMaxHeap

Class Documentation

template<class T, class Better = std::less<T>>
class MinMaxHeap

a min-max heap of plain items: the best and the worst by better()

Public Types

using Item = T

the type of the items

Public Functions

inline explicit MinMaxHeap(Better better = Better())
void push(const T &x)
const T &min(void) const
Pre:

the queue is not empty

const T &max(void) const
Pre:

the queue is not empty

T popMin(void)

removes the best item and returns it

Pre:

the queue is not empty

T popMax(void)

removes the worst item and returns it

Pre:

the queue is not empty

inline bool empty(void) const
inline std::size_t size(void) const
inline void reserve(std::size_t n)
inline void clear(void)