Queue Operations Multiple Questions and Answers.




21.If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
A. ABCD
B. DCBA
C. DCAB
D. ABDC

22. In the array implementation of circular queue, which of the following operation take worst case linear time?
A. Insertion
B. Deletion
C. To empty a queue
D. None

23.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.
A. 0
B. 7
C. 9
D. 10

24. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into a NONEMPTY queue?
A. Only front pointer
B. Only rear pointer
C. Both front and rear pointer
D. None of the front and rear pointer

25.Let the following circular queue can accommodate maximum six elements with the following data.What will happen after ADD O operation takes place?
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
A. front = 2 rear = 5 queue = ______; L, M, N, O, ___
B. front = 3 rear = 5 queue = L, M, N, O, ___
C. front = 3 rear = 4 queue = ______; L, M, N, O, ___
D. front = 2 rear = 4 queue = L, M, N, O, ___

«»



Quick Links

GAT Subject



   Computer Science    English    Agriculture    Botany    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC    PPSC    NTS