
Programming, Data Structures and Algorithms using Python Quiz 1: 13 July 2025 (May 2025 term)
The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 1 paper sat on 13 Jul 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
- 9
- 3
- 4
Show answer
Correct answer
Question 2
Show answer
Correct answer
Question 3
When using the binary search algorithm on a sorted list, consider the maximum number of comparisons it might take in the worst-case scenario to find an item or confirm it's absent. If the total number of items in this sorted list is doubled, how does this maximum number of comparisons change?
It doubles
It remains the same
It becomes half
It increases by 1
Show answer
Correct answer
It increases by 1
Question 4
When the input array is already sorted; the algorithm still performs redundant checks.
When the input array is sorted in reverse (descending) order; each element needs to be compared against and shifted past all previously sorted elements.
When the input array contains many duplicate elements; handling duplicates requires extra comparisons.
When the input array elements are randomly distributed; the lack of order maximizes the average number of shifts required.
Show answer
Correct answer
When the input array is sorted in reverse (descending) order; each element needs to be compared against and shifted past all previously sorted elements.
Question 5
Show answer
Correct answer
Question 6
Choosing a median value as the pivot for each recursive call.
Choosing either the smallest or the largest element as the pivot at each recursive call.
Choosing either the first or the last position element as the pivot at each recursive call.
Partitioning the array into two roughly equal halves at each recursive call.
Show answer
Correct answer
Choosing either the smallest or the largest element as the pivot at each recursive call.
Question 7
Show answer
Correct answer
Question 8
Show answer
Correct answer
Question 9
3
4
6
7
Show answer
Correct answer
7
Question 10
Show answer
Correct answers
Question 11
Show answer
Correct answers
Question 12
(1,4)
(2,4)
(3,4)
(3,5)
(4,5)
(1, 5)
Show answer
Correct answers
(2,4)
(3,5)
(4,5)
Question 13
Show answer
Correct answer: 8
Question 14
Show answer
Correct answer: 10
Question 15
Show answer
Correct answer: 2
Question 16
Show answer
Correct answer: 30