

MCQOPTIONS
Saved Bookmarks
This section includes 21 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
Queues serve major role in ______________ |
A. | Simulation of recursion |
B. | Simulation of arbitrary linked list |
C. | Simulation of limited resource allocation |
D. | Simulation of heap sort |
Answer» D. Simulation of heap sort | |
2. |
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 |
Answer» B. Front = (rear + 1)mod MAX_SIZE | |
3. |
A data structure in which elements can be inserted or deleted at/from both ends but not in the middle is? |
A. | Queue |
B. | Circular queue |
C. | Dequeue |
D. | Priority queue |
Answer» D. Priority queue | |
4. |
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 |
Answer» B. DCBA | |
5. |
Circular Queue is also known as ________ |
A. | Ring Buffer |
B. | Square Buffer |
C. | Rectangle Buffer |
D. | Curve Buffer |
Answer» B. Square Buffer | |
6. |
A queue follows __________ |
A. | FIFO (First In First Out) principle |
B. | LIFO (Last In First Out) principle |
C. | Ordered array |
D. | Linear tree |
Answer» B. LIFO (Last In First Out) principle | |
7. |
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. | Queue |
B. | Stack |
C. | Tree |
D. | Linked list |
Answer» B. Stack | |
8. |
In which of the following data structures, both insertion and deletion operations can take place at either end of the structure? |
A. | Deque |
B. | Priority queue |
C. | Stack |
D. | Queue |
Answer» B. Priority queue | |
9. |
Consider a standard circular queue ‘q’ implementation (which has same condition for queue full and queue empty) whose size is 11 and the elements of the queue are q[0], q[1], .... q[10]. The front and rear pointers are initialized to point at q[2]. In which position will the ninth element be added ? |
A. | q[0] |
B. | q[1] |
C. | q[9] |
D. | q[10] |
Answer» B. q[1] | |
10. |
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)? |
A. | Both operations can be performed in O(1) time |
B. | At most one operation can be performed in O(1) time but the worst case time for the other operation will be Ω(n) |
C. | The worst-case time complexity for both operations will be Ω(n) |
D. | Worst case time complexity for both operations will be Ω (log n) |
Answer» B. At most one operation can be performed in O(1) time but the worst case time for the other operation will be Ω(n) | |
11. |
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the near node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operations can be performed in O(1) time?I. Next pointer of front node points to the rear node.II. Next pointer of rear node points to the front node. |
A. | I only |
B. | II only |
C. | Both I and II |
D. | Neither I and II |
Answer» C. Both I and II | |
12. |
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.MultiDequeue(Q){m = kwhile (Q is not empty) and (m > 0) {Dequeue(Q)m = m – 1}}What is the worst case time complexity of a sequence of n queue operations on an initially empty queue? |
A. | Θ(n) |
B. | Θ(n + k) |
C. | Θ(nk) |
D. | Θ(n2) |
Answer» B. Θ(n + k) | |
13. |
Which of the following is not the type of queue? |
A. | Ordinary queue |
B. | Single ended queue |
C. | Circular queue |
D. | Priority queue |
Answer» C. Circular queue | |
14. |
Queues serve major role i? |
A. | Simulation of recursion |
B. | Simulation of arbitrary linked list |
C. | Simulation of limited resource allocation |
D. | All of the mentioned |
Answer» D. All of the mentioned | |
15. |
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 |
Answer» B. Front = (rear + 1)mod MAX_SIZE | |
16. |
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 |
Answer» D. Priority queue | |
17. |
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 |
Answer» B. DCBA | |
18. |
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 |
Answer» C. Linked list | |
19. |
A queue is a ? |
A. | FIFO (First In First Out) list |
B. | LIFO (Last In First Out) list |
C. | Ordered array |
D. | Linear tree |
Answer» B. LIFO (Last In First Out) list | |
20. |
The data structure required for Breadth First Traversal on a graph is? |
A. | Stack |
B. | Array |
C. | Queue |
D. | Tree |
Answer» D. Tree | |
21. |
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 |
Answer» B. Stack | |