MCQ - Queue in Data Structure
11. A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as a ?
A Queue
B Stack
C. Tree
D. Linked list
View Answer
Ans : A
Explanation: None.
12. The data structure required for Breadth First Traversal on a graph is?
A. Stack
B. Array
C. Queue
D. Tree
View Answer
Ans : C
Explanation: None.
13. A queue is a ?
A. FIFO (First In First Out) list
B. LIFO (Last In First Out) list
C. Ordered array
D. Linear tree
View Answer
Ans : A
Explanation: None.
14. In Breadth First Search of Graph, which of the following data structure is used?
A. Stack
B. Queue
C. Linked list
D. None of the mentioned
View Answer
Ans : B
Explanation: None
15. A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?
A. Queue
B. Circular queue
C. Dequeue
D. Priority queue
View Answer
Ans : C
Explanation: None.
16. A normal queue, if implemented using an array of size MAX_SIZE, gets full when
A. Rear = MAX_SIZE – 1
B Front = (rear + 1)mod MAX_SIZE
C. Front = rear + 1
D> Rear = front
View Answer
Ans : C
Explanation: Condition for size of queue.
17. Queues serve major role in
A. Simulation of recursion
B. Simulation of arbitrary linked list
C. Simulation of limited resource allocation
D. All of the mentioned
View Answer
Ans : C
Explanation: Rest all are implemented using other data structures.
18. Which of the following is not the type of queue?
A. Ordinary queue
B. Single ended queue
C. Circular queue
D. Priority queue
View Answer
Ans : B
Explanation: Queue always has two ends.
19. Which of the following properties is associated with a queue?
A. First In Last Out
B. First In First Out
C. Last In First Out
D. None of the mentioned
View Answer
Ans : B
Explanation: Queue follows First In First Out structure.
20. What does the following piece of code do?
public Object function()
{
if(isEmpty())
return -999;
else
{
Object high;
high = q[front];
return high;
}
}
A. Dequeue
B. Enqueue
C. Return the front element
D. None of the mentioned
View Answer
Ans : C
Explanation: q[front] gives the element at the front of the queue, since we are not moving the ‘front’ to the next element,
it is not a dequeue operation.
Also Check :
Discussion