



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!




BusSStop
front
rear
rear^
rear^
rear
rear
BusSStop
front
rear^
rear
rear
BusSStop
front
rear
rear
BusSStop
front
rear
rear
Si^
f 0
Size - 1 6
front 1 4 1
back 3 4
back
Size
Size - 1 6
front 2 4 1
front 2 3 4 5
4 back
Size
Size - 1 6
front
back
Size
Size - 1 6
front
back
-^ However, this is the same case, but when the array isfull.
Size
Size - 1 6
front
4 back
Si^
Size - 1 6
count = size; 1 4 3
(^4 )
Full !! 2
front
4 back
7
6
12
67
7
6
12
67
0
1
2
3
4
5
6
7
8
Front=5Front=5 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=5Rear=