25 #ifndef _TPIE_PQ_OVERFLOW_HEAP_H_
26 #define _TPIE_PQ_OVERFLOW_HEAP_H_
38 template<
typename T,
typename Comparator = std::less<T> >
53 void push(
const T& x);
72 stream_size_type
size()
const;
116 memory_size_type maxsize;
120 template<
typename T,
typename Comparator>
123 #include "pq_overflow_heap.inl"
void pop()
Remove the top element from the priority queue.
pq_overflow_heap(memory_size_type maxsize, Comparator c=Comparator())
Constructor.
Simple heap based priority queue implementation.
void push(const T &x)
Insert an element into the priority queue.
void sorted_pop()
Remove all elements from queue.
bool empty() const
Return true if queue is empty otherwise false.
stream_size_type size() const
Returns the size of the queue.
const T & top()
See what's on the top of the priority queue.
T * sorted_array()
Sorts the underlying array and returns a pointer to it, this operation invalidates the heap...
Overflow Priority Queue, based on a simple Heap.
static const double sorted_factor
The factor of the size, total, which is returned sorted.
bool full() const
Returns whether the overflow heap is full or not.
memory_size_type sorted_size() const
Return size of sorted array.