Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

using namespace std

int queue[100], n = 100, front = - 1, rear = - 1

void Insert()

int val

rear == n - 1

 True   False 

front == - 1

cout<<"Queue Overflow"<<endl  True 

front = 0  False 

cout<<"Insert the element in queue : "<<endl

cin>>val

rear++

queue[rear] = val

void Delete()

front == - 1 || front > rear

 True   False 

cout<<"Queue Underflow " cout<<"Element deleted from queue is : "<< queue[front] <<endl

front++

void Display()

front == - 1

 True   False 

cout<<"Queue elements are : "

cout<<"Queue is empty"<<endl

int i = front

i <= rear

 False   True 

cout<<endl cout<<queue[i]<<" "

int main() i++

int ch

cout<<"1) Insert element to queue"<<endl

cout<<"2) Delete element from queue"<<endl

cout<<"3) Display all the elements of queue"<<endl

You might also like