What is the key principle behind a queue?
A
LIFO (Last In First Out) B
FIFO (First In First Out) C
FILO (First In Last Out) D
LILO (Last In Last Out)
Analysis & Theory
Queues follow FIFO — the first element added is the first to be removed.
Which of the following operations are used in a queue?
A
Push and Pop B
Insert and Delete C
Enqueue and Dequeue D
Add and Remove
Analysis & Theory
Enqueue adds to the rear, and Dequeue removes from the front of the queue.
What happens when you try to dequeue from an empty queue?
A
Returns 0 B
Performs no operation C
Underflow occurs D
Adds a null value
Analysis & Theory
Trying to remove an element from an empty queue results in underflow.
Which of the following is a real-life example of a queue?
A
Stack of books B
Undo feature in an editor C
Queue at a movie ticket counter D
Call stack
Analysis & Theory
Queue at a ticket counter represents FIFO behavior of a queue.
Which of the following queue types allows insertion and deletion from both ends?
A
Priority Queue B
Circular Queue C
Simple Queue D
Deque
Analysis & Theory
Deque (Double-Ended Queue) allows insert and delete from both front and rear.
What is the time complexity of enqueue and dequeue operations in a queue (using array or linked list)?
A
O(1) B
O(log n) C
O(n) D
O(n log n)
Analysis & Theory
Both operations are done in constant time: O(1).
What is a circular queue?
A
A queue that wraps around the end of an array B
A queue implemented using a tree C
A queue that uses recursion D
A queue with no rear pointer
Analysis & Theory
In a circular queue, the last position is connected to the first to utilize empty space.
Which data structure is used in **Breadth-First Search (BFS)** of a graph?
A
Stack B
Queue C
Heap D
Tree
Analysis & Theory
BFS uses a queue to keep track of the nodes to visit next.
Which of the following is **not** a type of queue?
A
Simple Queue B
Priority Queue C
Dequeue Queue D
Circular Queue
Analysis & Theory
It's called Deque (Double Ended Queue), not 'Dequeue Queue'.
In a priority queue, elements are removed based on:
A
Arrival time B
Position in queue C
Assigned priority D
Size of data
Analysis & Theory
In a priority queue, elements with higher priority are dequeued before others.