33 std::vector<unsigned int> contents;
39 bool operator()(
const unsigned int e1,
const unsigned int e2) {
return e1 > e2; }
47 bool is_empty()
const {
return contents.empty(); }
53 void clear() {contents.clear(); }
61 contents.push_back(e);
62 std::push_heap(contents.begin(), contents.end(), gt);
69 unsigned int smallest()
const {
return contents.front(); }
76 unsigned int remove() {
77 const unsigned int result =
smallest();
78 std::pop_heap(contents.begin(),contents.end(), gt);
86 size_t size()
const {
return contents.size(); }
size_t size() const
Definition: heap.hh:86
Definition: abstractgraph.cc:35
unsigned int smallest() const
Definition: heap.hh:69
A min-heap of unsigned integers.
Definition: heap.hh:31
void insert(const unsigned int e)
Definition: heap.hh:60
void clear()
Definition: heap.hh:53
bool is_empty() const
Definition: heap.hh:47