
Programming, Data Structures and Algorithms using Python Quiz 2: 3 August 2025 (May 2025 term)
The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 2 paper sat on 3 Aug 2025, in the May 2025 term: 16 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
- 16
- 50
- 120 min
- 10
- 3
- 3
Show answer
Correct answer
Question 2
[12, 18, 20, 19, 32, 37, 27, 26, 29]
[12, 18, 20, 19, 32, 27, 37, 29, 26]
[12, 18, 19, 20, 27, 32, 37, 29, 26]
[12, 20, 18, 19, 32, 27, 37, 26, 29]
Show answer
Correct answer
[12, 18, 20, 19, 32, 27, 37, 29, 26]
Question 3
Consider the given statements below about Prim's algorithm's behaviour and properties. i. The choice of the starting vertex can lead to different Minimum Spanning Trees if multiple MSTs exist with the same total weight.
ii. Prim's algorithm first sorts all edges in the graph by weight.
iii. The algorithm maintains a set of visited vertices and, at each step, selects the minimum weight edge connecting a visited vertex to an unvisited vertex.
Which of the given statements are True?
Statements i and ii
Statements ii and iii
Statements i and iii
All statements i, ii and iii
Show answer
Correct answer
Statements i and iii
Question 4
7
8
9
10
Show answer
Correct answer
7
Question 5
71
36
37
29
Show answer
Correct answer
29
Question 6
Consider the following statements and select the correct option.
i. The greedy technique always gives an optimized solution to the problem.
ii. Bellman-Ford and Floyd-Warshal algorithms use the greedy technique to solve the path problems.
Statements (i) and (ii) are false.
Statements (i) and (ii) are true.
Statement (i) is true and Statement (ii) is false.
Statement (i) is false and Statement (ii) is true.
Show answer
Correct answer
Statements (i) and (ii) are false.
Question 7
Show answer
Correct answer
Question 8
328
82
100
126
Show answer
Correct answer
126
Question 9
A-3, B-1, C-2, D-4
A-4, B-1, C-3, D-2
A-4, B-1, C-2, D-3
A-1, B-3, C-2, D-4
Show answer
Correct answer
A-4, B-1, C-2, D-3
Question 10
15
9
14
17
Show answer
Correct answer
15
Question 11
Which of the following is/are True about Bellman-Ford algorithm?
It can handle disconnected graphs.
The shortest path is not stabilized, if there are negative cycles.
It can handle negative edge weights, but not negative cycles.
It uses the greedy approach to find the shortest path.
Show answer
Correct answers
It can handle disconnected graphs.
The shortest path is not stabilized, if there are negative cycles.
It can handle negative edge weights, but not negative cycles.
Question 12
Show answer
Correct answers
Question 13
Which of the following statements are true about the finding the closest pair of points using divide and conquer strategy?
Show answer
Correct answers
Question 14
Show answer
Correct answer: 15
Question 15
Show answer
Correct answer: 31
Question 16
Show answer
Correct answer: 12