Namespace pairing_queue¶
-
namespace
pairing_queue -
template <typename P>
class pairing_queuepairing_queue - #include <pairing_queue.hpp>
A priority queue based on a pairing heap, with fixed memory footprint and support for a decrease-key operation.
Subclassed by pairing_queue::pairing_queue_fast_reset< P >
Public Functions
-
void pairing_queue::pairing_queue
reset_fill(const P &v) Reset the queue and fill the values with a default.
-
void pairing_queue::pairing_queue
reset() Reset the queue and set the default to the maximum value.
-
bool pairing_queue::pairing_queue
delete_min() Remove the minimum value return true if any change is made.
-
bool pairing_queue::pairing_queue
pop_min(int &key, P &value) Remove and return (in args) the minimum key, value pair.
-
void pairing_queue::pairing_queue
decrease_value(int k, const P &v) Decrease the value of k to v NOTE: Assumes that v is lower than the current value of k.
-
bool pairing_queue::pairing_queue
check_decrease_value(int k, const P &v) Decrease the value of k to v Does nothing if v isn’t actually a decrease.
-
void pairing_queue::pairing_queue
-
template <typename P>
class pairing_queuepairing_queue_fast_reset: public pairing_queue::pairing_queue<P> - #include <pairing_queue.hpp>
This is a specialization of the pairing_queue that has a constant time reset method, at the expense of an extra check when values are set or updated.
-
template <typename P>