A min-heap of unsigned integers.
More...
#include <heap.hh>
A min-heap of unsigned integers.
◆ clear()
void bliss::Heap::clear |
( |
| ) |
|
|
inline |
Remove all the elements in the heap. Time complexity is O(1).
◆ insert()
void bliss::Heap::insert |
( |
const unsigned int |
e | ) |
|
|
inline |
Insert the element e in the heap. Time complexity is O(log(N)), where N is the number of elements currently in the heap.
◆ is_empty()
bool bliss::Heap::is_empty |
( |
| ) |
const |
|
inline |
Is the heap empty? Time complexity is O(1).
◆ remove()
unsigned int bliss::Heap::remove |
( |
| ) |
|
|
inline |
Remove and return the smallest element in the heap. Time complexity is O(log(N)), where N is the number of elements currently in the heap.
◆ size()
size_t bliss::Heap::size |
( |
| ) |
const |
|
inline |
Get the number of elements in the heap.
◆ smallest()
unsigned int bliss::Heap::smallest |
( |
| ) |
const |
|
inline |
Return the smallest element in the heap. Time complexity is O(1).
The documentation for this class was generated from the following file: