WorksheetsQueue
Total questions: 20
Worksheet time: 13mins
In linked list implementation of a queue, where does a new element be inserted?
At the head of link list
At the centre position in the link list
At the tail of the link list
None of the mentioned
In linked list implementation of a queue, the important condition for a queue to be empty is?
FRONT is null
REAR is null
LINK is empty
None of the mentioned
In a circular queue, how do you increment the rear end of the queue?
rear++
(rear+1) % Number of Item
(rear % Number of Item)+1
rear–
Which is the application of a queue?
CPU allocation
Sharing printer
Graph traversal
All
If REAR, FRONT are the queue variables, then identify correct statement while inserting a value
FRONT=1
REAR=REAR+1
REAR=REAR-1
FRONT=FRONT-1
If elements are inserted in the order -10,-2,-3,4,-1,6 then to delete value -3 how many dequeue operations are required?
(a)
Time complexity of enqueue is
O(n)
O(1)
O(nlogn)
O(logn)
Number of queues required to implement a stack is
1
2
3
cannot be implemented
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
7
9
10
0
In linked list implementation of a queue, where does a new element be inserted?
At the head of link list
At the centre position in the link list
At the tail of the link list
None of the mentioned
In linked list implementation of a queue, from where is the item deleted?
At the head of link list
At the centre position in the link list
At the tail of the link list
None of the mentioned
Let the following circular queue can accommodate maximum six elements with the following data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?
front = 2 rear = 5
queue = ______; L, M, N, O, ___
front = 3 rear = 5
queue = L, M, N, O, ___
front = 3 rear = 4
queue = ______; L, M, N, O, ___
front = 2 rear = 4
queue = L, M, N, O, ___
What is the reason for using a "circular queue" instead of a regular one?
running time of enqueue() is improved
reuse empty spaces
you can traverse all the elements more efficiently
none of the above
One difference between a queue and a stack is:
Queues require dynamic memory, but stacks do not
Stacks require dynamic memory, but queues do not.
Queues use two ends of the structure; stacks use only one.
Stacks use two ends of the structure, queues use only one.
If the numbers 5, 10, 3, 42 are enqueued onto a queue in that order, what does dequeue return?
5
10
3
42
The essential condition which is checked before insertion in a linked queue is?
Underflow
Overflow
Front value
Rear value
A queue of characters currently contained A,B,C,D What would be the contents of queue after the following operationDELETE, ADD W, ADD X, DELETE, ADD Y.
A,B,C,W,Y
A,B,C,D,W
C,D,W,X,Y
W,Y,X,C,D
If front=rear ,then the queue is?
full
undeflow
overflow
empty
Insertion operation is done at only one end and
deletion operation is done at both the ends
Input Restricted Queue
Output Restricted Queue
Priority Queue
None of these
Deletion operation is done at only one end and insertion
operation is done at both the ends
Input Restricted Queue
Output Restricted Queue
Priority Queue
None of these
