TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Implementation of Linear [Queue using array] (https://www.geeksforgeeks.org/array-implementation-of-queue-simple/). More...
#include <array>
#include <cstdint>
#include <iostream>
Go to the source code of this file.
Classes | |
class | data_structures::queue_using_array::Queue_Array |
Queue_Array class containing the main data and also index of head and tail of the array. More... | |
Namespaces | |
namespace | data_structures |
for IO operations | |
namespace | queue_using_array |
Functions for [Queue using Array] (https://www.geeksforgeeks.org/array-implementation-of-queue-simple/) implementation. | |
Functions | |
int | main () |
Main function. | |
Variables | |
constexpr uint16_t | max_size {10} |
for std::array | |
Implementation of Linear [Queue using array] (https://www.geeksforgeeks.org/array-implementation-of-queue-simple/).
The Linear Queue is a data structure used for holding a sequence of values, which can be added to the end line (enqueue), removed from head of line (dequeue) and displayed.
Values can be added by increasing the rear
variable by 1 (which points to the end of the array), then assigning new value to rear
's element of the array.
Values can be removed by increasing the front
variable by 1 (which points to the first of the array), so it cannot reached any more.
Definition in file queue_using_array.cpp.
int main | ( | void | ) |
Main function.
Allows the user to add and delete values from the queue. Also allows user to display values in the queue.
Definition at line 112 of file queue_using_array.cpp.
|
constexpr |
for std::array
for io operations Maximum size of the queue
Definition at line 24 of file queue_using_array.cpp.