52 std::array<int16_t, max_size>
arr{};
61 std::cout <<
"\nStack is full";
79 std::cout <<
"\nstack is empty ";
96 std::cout <<
"\nStack is empty";
98 for (int16_t i{
front}; i <=
rear; ++i) std::cout <<
arr.at(i) <<
" ";
116 std::cout <<
"\n1. enqueue(Insertion) ";
117 std::cout <<
"\n2. dequeue(Deletion)";
118 std::cout <<
"\n3. Display";
119 std::cout <<
"\n4. Exit";
121 std::cout <<
"\nEnter your choice ";
124 std::cout <<
"Enter data ";
127 }
else if (op == 2) {
129 std::cout <<
"\ndequeue element is:\t" <<
data;
130 }
else if (op == 3) {
132 }
else if (op == 4) {
135 std::cout <<
"\nWrong choice ";
Queue_Array class containing the main data and also index of head and tail of the array.
int dequeue()
Delete element from back of the queue.
int8_t front
Index of head of the array.
void enqueue(const int16_t &)
Add element to the first of the queue.
void display() const
Show all saved data.
int8_t rear
Index of tail of the array.
std::array< int16_t, max_size > arr
All stored data.
Functions for [Queue using Array] (https://www.geeksforgeeks.org/array-implementation-of-queue-simple...
constexpr uint16_t max_size
for std::array