Implementations of certain algorithms and data structures.
Bruno Rahle
To get you started, you can use something like this
#include <data_structures/queue/random_access_queue.h>
template <class T, size_t size>
using Queue =
data_structures::
queue::
RandomAccessQueue <T, size, size>;
using UIntQueue = Queue <uint32_t, N>;
UIntQueue Q;
void push(T x)
- adds the element to the queueT pop()
- returns the front element from the queue and removes itT front()
- returns the front element from the queueconst T& operator[](size_t i) const
- returns the i-th element from the queue, const versionT& operator[]
- returns the i-th element from the queue
All operations are O(1) time, and it uses O(N) memory.
Run make src\-C src\data_structures\queue\__tests__
or make -C src\data_structures\queue\__tests__ random_access_queue_debug