1. : What is a queue in data structures?
(A) A data structure that allows random access
(B) A data structure that follows LIFO (Last In, First Out) principle
(C) A data structure that follows FIFO (First In, First Out) principle
(D) A data structure that requires sorting before access
2. : Which operation adds an element to the rear of the queue?
(A) Enqueue
(B) Dequeue
(C) Front
(D) Rear
3. : What happens when you dequeue an element from an empty queue?
(A) Queue becomes undefined
(B) Queue becomes null
(C) An error occurs
(D) Nothing happens
4. : What is the time complexity of the enqueue operation in a queue implemented using an array with sufficient capacity?
(A) O(1)
(B) O(log n)
(C) O(n)
(D) O(n log n)
5. : Which operation removes and returns the front element of the queue?
(A) Enqueue
(B) Dequeue
(C) Front
(D) Rear
6. : What is the time complexity of the dequeue operation in a queue implemented using a linked list?
(A) O(1)
(B) O(log n)
(C) O(n)
(D) O(n log n)
7. : Which operation returns the front element of the queue without removing it?
(A) Enqueue
(B) Dequeue
(C) Front
(D) Rear
8. : What happens when you peek at the front element of an empty queue?
(A) Queue becomes undefined
(B) Queue becomes null
(C) An error occurs
(D) Nothing happens
9. : What is the time complexity of the front operation in a queue?
(A) O(1)
(B) O(log n)
(C) O(n)
(D) O(n log n)
10. : Which of the following statements is true about queue operations?
(A) Enqueue and dequeue can be performed simultaneously
(B) Dequeue removes the rear element of the queue
(C) Front changes the queue size
(D) Enqueue can be performed only once
11. : Which data structure is commonly used to implement a queue?
(A) Stack
(B) Array
(C) Linked list
(D) Tree
12. : In a queue, which operation modifies the size of the queue?
(A) Enqueue
(B) Dequeue
(C) Front
(D) None of the above
13. : What happens if you try to enqueue an element into a full queue (using an array implementation)?
(A) The element is added at the rear
(B) Queue becomes undefined
(C) An error occurs
(D) Nothing happens
14. : Which queue operation is used to check if a queue is empty?
(A) isEmpty
(B) isFull
(C) size
(D) length
15. : What is the space complexity of a queue operation?
(A) O(1)
(B) O(log n)
(C) O(n)
(D) O(n log n)
16. : Which of the following statements is true about the queue data structure?
(A) It allows elements to be accessed randomly
(B) It follows LIFO (Last In, First Out) principle
(C) It is used for breadth-first search algorithms
(D) It is used for depth-first search algorithms
17. : What is the primary limitation of using an array to implement a queue?
(A) Limited capacity
(B) Slow access time
(C) Inefficient insertion and deletion
(D) Inability to perform enqueue operation
18. : Which queue operation is responsible for decreasing the size of the queue?
(A) Enqueue
(B) Dequeue
(C) Front
(D) None of the above
19. : Which queue operation can be used to reverse the order of elements?
(A) Enqueue
(B) Dequeue
(C) Front
(D) None of the above
20. : In queue operations, what does the term “rear” refer to?
(A) The element at the front of the queue
(B) The size of the queue
(C) The element at the rear of the queue
(D) The middle element of the queue