The cppdsa-queue
Library#
C++DSA - Queue (cppdsa-queue
) is a modern C++ library that provides
generic implementations of the Queue ADT and related algorithms. It supports static (compile-time) polymorphism
and is extensible by means of template programming.
...
#include "circ_array_queue.hpp" // CircArrayQueue<Elem>
int main() {
auto q = dsa::CircArrayQueue<int> {};
q.enqueue(3);
q.enqueue(1);
...
while (!q.empty()) {
std::cout << q.front() << ' ';
q.dequeue();
}
std::cout << std::endl;
...
return 0;
}
Two implementations of the Queue ADT are included in the project off the shelf:
dsa::CircArrayQueue : Circular array based implementation
dsa::SLListQueue : Singly linked list based implementation
Contents#
Source Code#
Browse the source code on Github.
The cppdsa-queue
project is licensed under the
BSD 3-Clause License.
Also Want It In Another Language?#
C : Repository | Documentation
Go : Repository | Documentation [coming soon]
Python : Repository | Documentation
TypeScript : Repository | Documentation
The C language equivalent – cdsa-queue – is basically the procedural programming version of cppdsa-queue
but without the compile-time polymorphism
capabilities.