Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History
Public Member Functions | |
bin_heap (const Pred &prd) | |
Creates empty binary heap. | |
bin_heap (const Pred &prd, const int est_size) | |
Creates empty binary heap. | |
bin_heap (const bin_heap< T, Pred > &bh) | |
Copy constructor. | |
bin_heap< T, Pred > & | operator= (const bin_heap< T, Pred > &bh) |
Assigns bh to this binary heap. | |
~bin_heap () | |
Destructor. | |
void | push (const T &ins) |
Inserts ins in heap. | |
void | pop () |
Removes the element on top of the heap. | |
const T & | top () const |
Returns a reference to the element at the top of the heap. | |
void | changeKey (const T &cha) |
Reconstructs heap condition after changing key value of cha externally. | |
bool | is_empty () const |
Checks if heap is empty. |
Creates empty binary heap.
prd | binary predicate to compare two T s |
bin_heap< T, Pred >::bin_heap | ( | const Pred & | prd, | |
const int | est_size | |||
) | [inline] |
Creates empty binary heap.
prd | binary predicate to compare two Ts | |
est_size | estimated maximal size of heap |
bin_heap< T, Pred >::bin_heap | ( | const bin_heap< T, Pred > & | bh | ) | [inline] |
Copy constructor.
bh | binary heap to copy |
bin_heap< T, Pred > & bin_heap< T, Pred >::operator= | ( | const bin_heap< T, Pred > & | bh | ) | [inline] |
Assigns bh
to this binary heap.
All elements in this heap will be deleted. The predicate of this heap must be physically the same as the one of bh
.
bh | binary heap |
void bin_heap< T, Pred >::push | ( | const T & | ins | ) | [inline] |
Inserts ins
in heap.
ins | data element to be inserted |
const T & bin_heap< T, Pred >::top | ( | ) | const [inline] |
Returns a reference to the element at the top of the heap.
void bin_heap< T, Pred >::changeKey | ( | const T & | cha | ) | [inline] |
Reconstructs heap condition after changing key value of cha
externally.
cha | element with changed key value |
changeKey
doesn't operate if cha
is a primitive data structure, because it represents its key value itself, or if one object is stored more than once in the data structure.bool bin_heap< T, Pred >::is_empty | ( | ) | const [inline] |
Checks if heap is empty.
true
iff empty
University of Passau - FMI - Theoretical Computer Science