Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 161 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.

151.

What does ‘stack overflow’ refer to?

A. accessing item from an undefined stack
B. adding items to a full stack
C. removing items from an empty stack
D. index out of bounds exception
Answer» C. removing items from an empty stack
152.

The postfix form of the expression (A+B)∗(C∗D-E)∗F/G is

A. AB+CDE∗ −∗F∗G/
B. AB+CD ∗ E−∗F∗G/
C. AB+CD ∗ E−F∗∗G/
D. AB+CD ∗ E−FG/∗∗
Answer» E.
153.

What data structure is used for breadth first traversal of a graph?

A. queue
B. stack
C. list
D. none of the above
Answer» B. stack
154.

Aposterior analysis are more accurate than apriori analysis because −

A. it contains the real data.
B. it assumes all other factors to be dynamic.
C. it assumes all other factors to be constant.
D. it is a result of reverse-engineering.
Answer» C. it assumes all other factors to be constant.
155.

If locality is a concern, you can use _______ to traverse the graph.

A. Breadth First Search
B. Depth First Search
C. Either BFS or DFS
D. None of the above!
Answer» C. Either BFS or DFS
156.

In conversion from prefix to postfix using stack data-structure, if operators and operands are pushed and popped exactly once, then the run-time complexity is

A. Ο(1)
B. Ο(n)
C. Ο(log n)
D. Ο(n2)
Answer» C. Ο(log n)
157.

Prefix notation is also known as

A. Reverse Polish Notation
B. Reverse Notation
C. Polish Reverse Notation
D. Polish Notation
Answer» E.
158.

Stack is used for

A. CPU Resource Allocation
B. Breadth First Traversal
C. Recursion
D. None of the above
Answer» D. None of the above
159.

push() and pop() functions are found in

A. queues
B. lists
C. stacks
D. trees
Answer» D. trees
160.

If queue is implemented using arrays, what would be the worst run time complexity of queue and dequeue operations?

A. Ο(n), Ο(n)
B. Ο(n), Ο(1)
C. Ο(1), Ο(n)
D. Ο(1), Ο(1)
Answer» E.
161.

Minimum number of queues required for priority queue implementation?

A. 5
B. 4
C. 3
D. 2
Answer» E.