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(); }
77 const unsigned int result =
smallest();
78 std::pop_heap(contents.begin(),contents.end(), gt);
86 size_t size()
const {
return contents.size(); }
A min-heap of unsigned integers.
Definition: heap.hh:32
void clear()
Definition: heap.hh:53
void insert(const unsigned int e)
Definition: heap.hh:60
size_t size() const
Definition: heap.hh:86
unsigned int smallest() const
Definition: heap.hh:69
unsigned int remove()
Definition: heap.hh:76
bool is_empty() const
Definition: heap.hh:47
Definition: abstractgraph.cc:35