Template Class RadixHeap
Defined in File RadixHeap.h
Nested Relationships
Nested Types
Class Documentation
-
template<class T, std::integral K = std::uint32_t, unsigned B = 4>
class RadixHeap a monotone queue of items with integer keys K, the least key first, in buckets by digits of B bits
Public Functions
-
K peekKey(void) const
the least key, read from the least key of the first bucket in use, which does not move the buckets: the keys pushed next need only be not smaller than the last one extracted, as if topKey() were not called
- Pre:
the queue is not empty
-
template<class F>
void extractBelow(K limit, F &&f) removes the items of keys below limit, calling f( item , key ) for each of them in no given order, which count as extracted: the buckets whose keys are all below limit are emptied whole, with no move, and the first one that holds a key not below it is moved to the rows below for its least key, as by pop(), until the limit falls between two buckets or within one of the row 0
-
inline bool empty(void) const
-
inline std::size_t size(void) const
-
void clear(void)
removes the items, the buckets keeping their memory; any key may be pushed next
-
K peekKey(void) const