std::array<int16_t, max_size>
arr{};
61std::cout <<
"\nStack is full";
66}
else if(
rear<
arr.size()) {
79std::cout <<
"\nstack is empty ";
96std::cout <<
"\nStack is empty";
98 for(int16_t i{
front}; i <=
rear; ++i) std::cout <<
arr.at(i) <<
" ";
116std::cout <<
"\n1. enqueue(Insertion) ";
117std::cout <<
"\n2. dequeue(Deletion)";
118std::cout <<
"\n3. Display";
119std::cout <<
"\n4. Exit";
121std::cout <<
"\nEnter your choice ";
124std::cout <<
"Enter data ";
127}
else if(op == 2) {
129std::cout <<
"\ndequeue element is:\t"<<
data;
130}
else if(op == 3) {
132}
else if(op == 4) {
135std::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
int main()
Main function.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4