Question : What is a Queue?
Solution :
Correct Answer : FIFO data structure
Description -
Question : Which operation inserts an element into a queue?
Solution :
Correct Answer : Enqueue
Description -
Question : Which operation removes an element from a queue?
Solution :
Correct Answer : Dequeue
Description -
Question : In a queue, insertion takes place at:
Solution :
Correct Answer : Rear
Description -
Question : In a queue, deletion takes place at:
Solution :
Correct Answer : Front
Description -
Question : Which of the following is a real-life example of a queue?
Solution :
Correct Answer : People waiting at a ticket counter
Description -
Question : What is the time complexity of Enqueue operation in a simple queue?
Solution :
Correct Answer : O(1)
Description -
Question : What is the time complexity of Dequeue operation in a linked-list queue?
Solution :
Correct Answer : O(1)
Description -
Question : Which pointer indicates the first element of a queue?
Solution :
Correct Answer : Front
Description -
Question : Which pointer indicates the last element of a queue?
Solution :
Correct Answer : Rear
Description -
Question : What is Queue Overflow?
Solution :
Correct Answer : Queue becomes full
Description -
Question : What is Queue Underflow?
Solution :
Correct Answer : Queue becomes empty and deletion is attempted
Description -
Question : Which data structure is most suitable for implementing a queue dynamically?
Solution :
Correct Answer : Linked List
Description -
Question : In an array implementation of queue, which condition indicates an empty queue?
Solution :
Correct Answer : front = -1
Description -
Question : Which problem occurs in a linear queue implemented using arrays?
Solution :
Correct Answer : Memory wastage
Description -
Question : Circular Queue is used to:
Solution :
Correct Answer : Avoid memory wastage
Description -
Question : In a Circular Queue of size N, the next position of rear is:
Solution :
Correct Answer : (rear+1)%N
Description -
Question : Which queue serves elements according to priority?
Solution :
Correct Answer : Priority Queue
Description -
Question : Deque stands for:
Solution :
Correct Answer : Double Ended Queue
Description -
Question : Which operation is NOT allowed in an Input Restricted Deque?
Solution :
Correct Answer : Insert at front
Description -
Question : Consider Queue: [10, 20, 30, 40]
After one Dequeue and one Enqueue(50), queue becomes:
Solution :
Correct Answer : [20,30,40,50]
Description -
Question : A Circular Queue of size 5 has front=0 and rear=4. The queue is:
Solution :
Correct Answer : Full
Description -
Question : Which traversal algorithm uses a queue?
Solution :
Correct Answer : BFS
Description -
Question : Which scheduling algorithm uses a Circular Queue?
Solution :
Correct Answer : Round Robin
Description -
Question : In a Priority Queue:
Solution :
Correct Answer : Elements are removed based on priority
Description -
Question : If a queue contains A, B, C, D (front=A), after two dequeues and enqueue(E), enqueue(F), what is the queue?
Solution :
Correct Answer : C D E F
Description -
Question : Which application commonly uses a queue?
Solution :
Correct Answer : CPU Scheduling
Description -
Question : What is the maximum number of elements stored in a Circular Queue of size N using the condition (rear+1)%N == front for full queue?
Solution :
Correct Answer : N-1
Description -
Question : Which data structure is used internally in Breadth First Search?
Solution :
Correct Answer : Queue
Description -
Question : A queue implemented using linked list has front and rear pointers. What is the time complexity of Enqueue and Dequeue?
Solution :
Correct Answer : O(1), O(1)
Description -