Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#define SIZE 5 #define NULL _ VALUE 0 void next ( int * pointer ) ; void enqueue ( ) ; void dequeue ( )
#define SIZE
#define NULLVALUE
void nextint pointer;
void enqueue;
void dequeue;
void printqueue;
int bufferSIZE;
int head;
int tail;
int mainvoid
int menu;
while
printfSelect a number Enqueue Dequeue Queue Print Exit: ;
scanfd &menu;
if menu
enqueue;
else if menu
dequeue;
else if menu
printqueue;
else if menu
break;
return ;
void nextint pointer
if pointer SIZE
pointer pointer ;
else
pointer NULLVALUE;
void enqueue
int data;
printfEnqueue a number: ;
scanfd &data;
if NULLVALUE bufferhead
printfQueue is full
;
return;
bufferhead data;
next&head;
void dequeue
int data buffertail;
if NULLVALUE data
printfQueue is empty
;
return;
printfDequeued number: d
data;
buffertail NULLVALUE;
next&tail;
void printqueue
int i;
printfQueue is: ;
for i ; i SIZE; i
printfd bufferi;
printftHead: dtTail: d
head, tail;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started