|
Grok 20.3.2
|
A simple non-thread-safe min-heap for tracking contiguous sequences of size_t indices. More...
#include <MinHeap.h>
Public Member Functions | |
| void | push (T index) |
| Pushes an index onto the heap. | |
| std::optional< T > | push_and_pop (T index) |
| Pushes an index and returns the greatest integer at the end of the contiguous sequence. | |
| size_t | size () const |
| Returns the current size of the heap. | |
Private Attributes | |
| std::priority_queue< T, std::vector< T >, std::greater< T > > | queue |
| Min-heap of indices. | |
| T | start = 0 |
| Tracks the next expected index in the sequence. | |
A simple non-thread-safe min-heap for tracking contiguous sequences of size_t indices.
|
inline |
|
inline |
|
inline |
|
private |
Min-heap of indices.
Referenced by push(), push_and_pop(), and size().
|
private |
Tracks the next expected index in the sequence.
Referenced by push_and_pop().