












































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













































Zain Iqbal [email protected]
$ $
$ $
8
10
11
13
14
5 4 6 7 8 7 6 0 1 2 3 4 5 6 7 8 Front= Rear= 8 7 6 0 1 2 3 4 5 6 7 8 Front= Rear= 7 6 12 67 0 1 2 3 4 5 6 7 8 Front= Rear= How can we insert more elements? Rear index can not move beyond the last element….
7 6 12 67 0 1 2 3 4 5 6 7 8 Front= Rear= Enqueue 39 Rear=(Rear+1) mod Queue Size = (8+1) mod 9 = 0 39 7 6 12 67 0 1 2 3 4 5 6 7 8 Front= Rear=
17
19 IntQueue::IntQueue(int s) //constructor { queueArray = new int[s]; queueSize = s; front = - 1; rear = - 1; numItems = 0; } IntQueue::~IntQueue(void) //destructor { delete [] queueArray; }
20