Implements a heap that stores objects of type type, with priority keys of type ptype.
More...
#include <Heap.h>
|
const type & | top () const |
|
const ptype & | topPriority () const |
|
void | pop () |
|
void | push (const type &x, const ptype &p) |
|
int | find (const type &x) const |
|
int | findByPriority (const type &x, const ptype &p) const |
|
void | adjust (const type &x, const ptype &p) |
|
void | _adjust (int i, const ptype &p) |
|
void | clear () |
|
bool | empty () const |
|
int | size () const |
|
bool | isHeap () const |
|
void | print () const |
|
template<class type, class ptype>
class Heap< type, ptype >
Implements a heap that stores objects of type type, with priority keys of type ptype.
The highest priority item is always on top.
pop(), push(), and _adjust() run in worst-case time O(log n) adjust() and find() run in worst-case time O(n)
The documentation for this class was generated from the following file: