IT24111 & Problem Solving Techniques: Comprehensive Advanced
Exam on Algorithmic Paradigms, Computational Complexity,
Heuristic Search, Debugging, and Constraint Processing (2026,
Week 23)
Questions 1–150 (Multiple Choice)
1. Which of the following best defines a greedy algorithm?
A) Explores all possible solutions systematically
B) Makes the locally optimal choice at each stage with the hope of
finding global optimum
C) Solves subproblems independently and combines them
D) Stores results of subproblems to avoid recomputation
Correct Answer: B
Rationale: Greedy algorithms choose the best immediate option,
not necessarily optimal globally.
2. In computational thinking, abstraction allows a programmer to:
A) Break a problem into smaller pieces
B) Ignore irrelevant details to focus on essential concepts
C) Recognize patterns across different problems
D) Design step‑by‑step instructions
Correct Answer: B
Rationale: Abstraction hides complexity and highlights only
,relevant information.
3. Which search algorithm is optimal for a weighted graph with
non‑negative edges?
A) Depth‑first search
B) Breadth‑first search
C) Uniform cost search (Dijkstra)
D) Greedy best‑first search
Correct Answer: C
Rationale: Uniform cost search expands node with lowest path cost;
optimal for non‑negative weights.
4. The master theorem is used to solve recurrences of the form:
A) T(n) = aT(n/b) + f(n)
B) T(n) = T(n-1) + T(n-2)
C) T(n) = nT(n/2)
D) T(n) = √n T(√n) + n
Correct Answer: A
Rationale: Master theorem applies to divide‑and‑conquer
recurrences.
5. What is the worst‑case time complexity of bubble sort?
A) O(n)
,B) O(n log n)
C) O(n²)
D) O(log n)
Correct Answer: C
Rationale: Bubble sort repeatedly swaps adjacent elements; worst
case is quadratic.
6. In the 0/1 knapsack problem, dynamic programming is preferred
over greedy because:
A) Greedy never works for any knapsack variant
B) Greedy fails to guarantee optimality for fractional items
C) Greedy fails for 0/1 knapsack due to discrete nature
D) DP is always faster
Correct Answer: C
Rationale: Greedy by value/weight ratio fails for 0/1 knapsack; DP
ensures optimality.
7. Which heuristic for the 8‑puzzle is admissible?
A) Manhattan distance multiplied by 2
B) Number of misplaced tiles
C) Euclidean distance without considering obstacles
D) Both B and C are admissible
Correct Answer: D (both B and C are admissible)
Rationale: Misplaced tiles ≤ true cost; Euclidean distance ≤ true
, cost (ignores obstacles).
8. A backtracking algorithm for N‑Queens prunes branches when:
A) A queen is under attack
B) A queen is placed safely
C) All queens are placed
D) No more rows exist
Correct Answer: A
Rationale: Pruning occurs when a partial assignment violates
constraints.
9. The time complexity of the Bellman‑Ford algorithm on a graph
with V vertices and E edges is:
A) O(V + E)
B) O(VE)
C) O(V²)
D) O(E log V)
Correct Answer: B
Rationale: Bellman‑Ford relaxes all edges V‑1 times.
10. Which debugging technique is most effective for intermittent
bugs in multi‑threaded code?
A) Printf debugging
Exam on Algorithmic Paradigms, Computational Complexity,
Heuristic Search, Debugging, and Constraint Processing (2026,
Week 23)
Questions 1–150 (Multiple Choice)
1. Which of the following best defines a greedy algorithm?
A) Explores all possible solutions systematically
B) Makes the locally optimal choice at each stage with the hope of
finding global optimum
C) Solves subproblems independently and combines them
D) Stores results of subproblems to avoid recomputation
Correct Answer: B
Rationale: Greedy algorithms choose the best immediate option,
not necessarily optimal globally.
2. In computational thinking, abstraction allows a programmer to:
A) Break a problem into smaller pieces
B) Ignore irrelevant details to focus on essential concepts
C) Recognize patterns across different problems
D) Design step‑by‑step instructions
Correct Answer: B
Rationale: Abstraction hides complexity and highlights only
,relevant information.
3. Which search algorithm is optimal for a weighted graph with
non‑negative edges?
A) Depth‑first search
B) Breadth‑first search
C) Uniform cost search (Dijkstra)
D) Greedy best‑first search
Correct Answer: C
Rationale: Uniform cost search expands node with lowest path cost;
optimal for non‑negative weights.
4. The master theorem is used to solve recurrences of the form:
A) T(n) = aT(n/b) + f(n)
B) T(n) = T(n-1) + T(n-2)
C) T(n) = nT(n/2)
D) T(n) = √n T(√n) + n
Correct Answer: A
Rationale: Master theorem applies to divide‑and‑conquer
recurrences.
5. What is the worst‑case time complexity of bubble sort?
A) O(n)
,B) O(n log n)
C) O(n²)
D) O(log n)
Correct Answer: C
Rationale: Bubble sort repeatedly swaps adjacent elements; worst
case is quadratic.
6. In the 0/1 knapsack problem, dynamic programming is preferred
over greedy because:
A) Greedy never works for any knapsack variant
B) Greedy fails to guarantee optimality for fractional items
C) Greedy fails for 0/1 knapsack due to discrete nature
D) DP is always faster
Correct Answer: C
Rationale: Greedy by value/weight ratio fails for 0/1 knapsack; DP
ensures optimality.
7. Which heuristic for the 8‑puzzle is admissible?
A) Manhattan distance multiplied by 2
B) Number of misplaced tiles
C) Euclidean distance without considering obstacles
D) Both B and C are admissible
Correct Answer: D (both B and C are admissible)
Rationale: Misplaced tiles ≤ true cost; Euclidean distance ≤ true
, cost (ignores obstacles).
8. A backtracking algorithm for N‑Queens prunes branches when:
A) A queen is under attack
B) A queen is placed safely
C) All queens are placed
D) No more rows exist
Correct Answer: A
Rationale: Pruning occurs when a partial assignment violates
constraints.
9. The time complexity of the Bellman‑Ford algorithm on a graph
with V vertices and E edges is:
A) O(V + E)
B) O(VE)
C) O(V²)
D) O(E log V)
Correct Answer: B
Rationale: Bellman‑Ford relaxes all edges V‑1 times.
10. Which debugging technique is most effective for intermittent
bugs in multi‑threaded code?
A) Printf debugging