WorksheetsCircular queue
Total questions: 13
Worksheet time: 6mins
Circular Queue is ________ data structure.
linear
non-linear
both linear and non-linear
none
front = rear if and only if queue is full.
True
False
In circular queue, to add an element it will be necessary to move rear one position clockwise.
True
False
in circular queue _______ will always point one position counterclockwise from the first element in queue.
Top
Rear
Front
All positions
In a circular queue, how do you increment the rear end of the queue?
rear++
(rear+1) % SIZE
(rear % SIZE)+1
d) rear–-
What is the time complexity of enqueue operation?
O(logn)
O(nlogn)
O(n)
O(1)
A circular queue is implemented using an array of size 10.
The array index starts with 0, front is 6, and rear is 9. The insertion of next element takes place at the array index.
0
7
9
10
Which is not the type of queue?
Single ended queue
Ordinary queue
Circular queue
Priority queue
In Circular Queue (ARR) of size 3:
enqueue(1)
enqueue(2)
enqueue(3)
dequeue()
enqueue(4)
Index of Element 4?
0
1
2
3
Circular Queue (Arr) of Size 3:
enqueue(1)
enqueue(2)
enqueue(3)
dequeue()
dequeue()
dequeue()
enqueue(4)
Index of element 4 in Arr?
0
1
2
3
Check in Circular Queue is Empty:
int isEmpty() {
if (front == 0){
return 1;
}
return 0;
}
Find the mistake in the above code?
front == -1
No Mistake
front == rear+1
front == rear -1
In a circular queue, how do you increment the rear end of the queue?
(rear++)
(rear+1) % CAPACITY
(rear % CAPACITY)+1
rear--
What is the need for a circular queue?
effective usage of memory
to delete elements based on priority
easier computations
implement LIFO principle in queues
