A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d8/df0/queue__using__array_8cpp_source.html below:

TheAlgorithms/C++: data_structures/queue_using_array.cpp Source File

Go to the documentation of this file. 52

std::array<int16_t, max_size>

arr

{};

61

std::cout <<

"\nStack is full"

;

66

}

else if

(

rear

<

arr

.size()) {

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

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