|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Array-based dynamic binary heap. More...
#include <ah-concepts.H>#include <algorithm>#include <climits>#include <cstddef>#include <memory>#include <stdexcept>#include <type_traits>#include <utility>#include <tpl_dynArray.H>#include <ah-errors.H>#include <ah-iterator.H>Go to the source code of this file.
Classes | |
| struct | Aleph::dynarrayheap_detail::Way< T > |
| The places that an item passes, in order, when it is sifted. More... | |
| class | Aleph::DynArrayHeap< T, Compare > |
Dynamic heap (priority queue) backed by DynArray. More... | |
| class | Aleph::DynArrayHeap< T, Compare >::Iterator |
| Iterator on the items of the heap, in the order of its array, which is not the sorted one. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
| namespace | Aleph::dynarrayheap_detail |
Functions | |
| template<typename T , class Compare > | |
| size_t | Aleph::dynarrayheap_detail::up_index (DynArray< T > &a, const size_t l, const size_t r, T &x, Compare &cmp, Way< T > &way) noexcept(Aleph::NothrowPredicateWith< Compare &, T &, T & >) |
| Find where an item that enters at the end of a heap goes. | |
| template<typename T , class Compare > | |
| size_t | Aleph::dynarrayheap_detail::down_index (DynArray< T > &a, const size_t l, const size_t r, T &x, Compare &cmp, Way< T > &way) noexcept(Aleph::NothrowPredicateWith< Compare &, T &, T & >) |
| Find where an item that enters at the root of a heap goes. | |
| template<typename T > | |
| void | Aleph::dynarrayheap_detail::shift (T &first, const Way< T > &way, T &x) |
| Move an item along its way. | |
| template<typename T , class Compare > | |
| size_t | Aleph::sift_up (DynArray< T > &a, const size_t l, const size_t r, Compare &cmp) noexcept(Aleph::NothrowPredicateWith< Compare &, T &, T & >) |
| Restore heap order by moving an element up. | |
| template<typename T , class Compare > | |
| void | Aleph::sift_down (DynArray< T > &a, const size_t l, const size_t r, Compare &cmp) noexcept(Aleph::NothrowPredicateWith< Compare &, T &, T & >) |
| Restore heap order by moving an element down. | |
Array-based dynamic binary heap.
Binary heap using DynArray for automatic growth. Efficient for priority queues with unknown size.
Definition in file tpl_dynArrayHeap.H.