**DSA MCQ 2023**

**i. What is the overflow condition in a queue?**

- Rear < Front
- Front == SIZE – 1
**Rear == SIZE – 1**- Front == Rear

**ii. What is the postfix of the expression A + B * C / D?**

- AB + C * D /
- ABC + * D /
- ABCD + * /
- ABCD / * +

**ABC*D/+**

**iii. For a tree with n nodes, what will be the number of edges?**

- n – edges
**n – 1 edges**- 2n edges
- n / 2 edges

**iv. Which of the following heap trees contains nodes with values smaller or equal to the value in the parent node?**

**Min-heap**- Max-heap
- Min-max heap
- Max-min heap

**v. If there are n nodes in a binary tree, what will be the minimum height of the binary tree?**

- n
- n – 1
- nlogn
**logn**

**vi. In which category does Dijkstra’s algorithm belong?**

**Single source shortest path problem**- Single destination shortest path problem
- Single pair shortest path problem
- All pair shortest path problem

**vii. Which of the Following is the Worst-case scenario for the quicksort algorithm?**

- When elements are exactly partitioned into two halves
- When elements are randomly positioned
**When elements are already sorted**- When elements are merged by joining equal halves

**viii. Which type of algorithm benefits from the reusability of code?**

- Deterministic algorithms
- Non-deterministic algorithms
- Parallel algorithms
**Divide and conquer algorithm**

**ix. Which of the following searching algorithm has a time complexity of O(log n)?**

- Sequential search
**Binary search**- Depth-first search
- Breadth-first search

**x. Which of the following techniques in hashing has the consequences clustering problem?**

**Linear probing**- Quadratic probing
- Double hashing
- Rehashing