Question: EXERCISE 4: QUEUE IMPLEMENTATION LINEAR ARRAY AND CIRCULAR ARRAY a. Given the program below, answer the following question. 1 void main() 2 Queue q; 3



EXERCISE 4: QUEUE IMPLEMENTATION LINEAR ARRAY AND CIRCULAR ARRAY a. Given the program below, answer the following question. 1 void main() 2 Queue q; 3 X = 10; 4 Y = 15; 5 q.enqueue (x); 6 q.enqueue (y); 7 if (x % 50) 8 q.enqueue (y-x); 9 if (q.getFront () >= 10) 10 item = q.dequeue(); 11 q.enqueue (x+y); 12 item - q.dequeue (); 13 if (q.isFull()) 14 item = q.deQueue (); 15 q.enqueue (25 - 5); 16 cout = 10) item - q. dequeue (); [2] [1] [0] MINI front- rear - item- q. enqueue (x+y); item = q.dequeue(); [3] [2] [1] [0] front rear - item iv. if (q. isPull()) item = q.de Queue (); [3] [2] [1] [0] front- rear- item= isFull()- V. q. enqueue (25 - 5); cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
