|
ADS
Algorithms and Data Structures
|
a BucketQueue behind the interface of a heap of pairs \( ( k , x ) \), the key \( k \) of packFG(): the inner queue of a MultiQueue over such keys [see MultiQueue.h], whose pushes and pops take \( O( 1 ) \) amortized time with bounded keys where those of a heap take \( O( \log n ) \). More...
#include <ADS/priority/BucketQueue.h>
Public member functions | |
| BucketHeap (const C &=C()) | |
| the empty queue | |
| void | push (E &&e) |
| pushes e | |
| E | top (void) const |
| the least pair | |
| E | pop (void) |
| removes the least pair and returns it | |
| bool | empty (void) const |
| whether the queue has no pair | |
| std::size_t | size (void) const |
| the number of the pairs | |
a BucketQueue behind the interface of a heap of pairs \( ( k , x ) \), the key \( k \) of packFG(): the inner queue of a MultiQueue over such keys [see MultiQueue.h], whose pushes and pops take \( O( 1 ) \) amortized time with bounded keys where those of a heap take \( O( \log n ) \).
The queue keeps the items and their \( f \) and \( g \), the pair is made again when it comes out; E is an aggregate of a key and an item, in this order, and the order C, which a heap is given, must be the one of std::less on the keys, the one of the queue
|
inlineexplicit |
the empty queue
|
inlinenodiscard |
whether the queue has no pair
|
inline |
removes the least pair and returns it
|
inline |
pushes e
|
inlinenodiscard |
the number of the pairs
|
inlinenodiscard |
the least pair