Front and rear

Report a typo

Let's say we are implementing a queue for the first time ever, so we do it using an array, because it's pretty simple. We start with an empty array, representing the queue's initial state. We fill the queue with numbers:

10, 12, 9, 11, 5, 6, 8, 4

Write down the value of variable q[front]q[front] and value of variable q[rear]q[rear] after having completed the filling of the fifth element in the queue. The queue filling for the first three elements is shown in the illustration.

filling the queue

Provide answer separated by comma without space, for example: 15,7.

Enter a short text
___

Create a free account to access the full topic