42#include <gtest/gtest.h>
47using namespace testing;
94 const std::vector<int>
input{5, 3, 8, 1, 4, 9, 2, 7};
95 for (
int value :
input)
Fixed-capacity binary heap backed by a raw array.
T & insert(const T &key)
Insert an element into the heap.
constexpr bool is_empty() const noexcept
Return true if the heap is empty.
void update(T &data)
Update the priority of an element stored in the heap.
T getMin()
Remove the smallest element in the heap and return a copy of its value.
T & top()
Return a mutable reference to the minimum element.
constexpr size_t size() const noexcept
Return the number of elements currently stored.
void remove(T &item)
Remove an element from the heap given a reference to it.
iterator end() noexcept
Return an STL-compatible end iterator.
iterator begin() noexcept
Return an STL-compatible iterator to the first element.
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Fixed-capacity binary heap and heapsort algorithms.