Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Programming, Data Structures and Algorithms using Python
All 2025 papers
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Quiz 1 · 26 Oct 2025 (AN)Quiz 1
- Q1MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q2MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q3MCQ3 Marks·Choose one option

- A35, 51, 39, 47
- B35, 51, 47
- C35, 51, 43, 47
- D35, 55, 39, 47
- ENone of these
- Q4MCQ3 Marks·Choose one option

- A2
- B3
- C4
- D5
- Q5MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q6MCQ3 Marks·Choose one option

- AOnly Statement 1
- BOnly Statement 2
- COnly Statement 3
- DStatements 1 and 2
- EStatements 2 and 3
- Q7MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q8MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q9MCQ2 Marks·Choose one option

- A1-a, 2-b, 3-c, 4-d
- B1-b, 2-a, 3-d, 4-c
- C1-a, 2-b, 3-d, 4-c
- D1-c, 2-b, 3-a, 4-d
- Q10MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- E

- A
- Q11MSQ3 Marks·Choose all correct options
Consider a connected, undirected graph G with n vertices. A Breadth-First Search (BFS) traversal is performed starting from a source vertex s. Let d(s, v) denote the shortest distance (in terms of number of edges) from s to vertex v. Which of the following statements is true about the BFS traversal?
- AAll vertices at distance k from s are visited before any vertex at distance k + 1 from s.
- BOnce a vertex is visited, it is never visited again during the traversal.
- CBFS may fail to visit some vertices, even if the graph is connected.
- DThe time complexity of BFS using an adjacency list representation is O(n^2).
- Q12NAT3 Marks·Write the number
Your answer: - Q13NAT3 Marks·Write the number
Your answer: - Q14NAT3 Marks·Write the number
Your answer: - Q15NAT3 Marks·Write the number
Your answer: - Q16NAT3 Marks·Write the number
Your answer: - Q17NAT3 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (FN)End Term
- Q18MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q19MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q20MCQ4 Marks·Choose one option

- A2
- B3
- C4
- D5
- Q21MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q22MCQ4 Marks·Choose one option

- A

- B

- C

- A
- Q23MCQ4 Marks·Choose one option
Given a weighted graph where weights of all edges are unique, there is always a unique shortest path from a source to destination in such a graph.
- ATrue
- BFalse
- Q24MCQ4 Marks·Choose one option

- A[65, 50, 55, 30, 40, 35, 45, 10, 20]
- B[65, 50, 55, 40, 30, 35, 45, 10, 20]
- C[65, 55, 50, 40, 30, 35, 45, 10, 20]
- D[65, 50, 55, 40, 30, 35, 45, 20, 10]
- Q25MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q26MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q27MCQ4 Marks·Choose one option

- A4
- B5
- C6
- D7
- Q28MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q29MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q30MCQ4 Marks·Choose one option

- A14
- B15
- C13
- D16
- Q31MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q32MSQ4 Marks·Choose all correct options
Which of the following sorting algorithms will have the same time complexity irrespective of the sequence of elements in the input?
- ASelection Sort
- BMerge Sort
- CQuick Sort
- DInsertion Sort
- Q33MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q34MSQ4 Marks·Choose all correct options

- A13
- B8
- C9
- D10
- E11
- Q35MSQ4 Marks·Choose all correct options

- A10
- B20
- C22
- D25
- E40
- Q36MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- E

- F

- A
- Q37NAT4 Marks·Write the number
An undirected graph has 300 edges. What is the minimum number of vertices it must have?
Your answer: - Q38NAT4 Marks·Write the number
Your answer: - Q39NAT4 Marks·Write the number
Your answer: - Q40NAT4 Marks·Write the number
A binary tree has 7 nodes. What is the minimum possible height of this tree (assuming the empty tree height is 0)?
Your answer: - Q41NAT4 Marks·Write the number
Your answer: - Q42NAT4 Marks·Write the number
Your answer:
End Term · 31 Aug 2025 (AN)End Term
- Q43MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q44MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q45MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q46MCQ4 Marks·Choose one option
Consider the following statements: 1. While creating a DFS tree for a directed graph, among non-tree edges, only back edges correspond to cycles. 2. The depth of any DFS tree rooted at a vertex is at least as much as the depth of any BFS tree rooted at the same vertex. Choose the correct option.
- AOnly statement 1 is true
- BOnly statement 2 is true
- CBoth statements 1 and 2 are true
- DBoth statements 1 and 2 are false
- Q47MCQ4 Marks·Choose one option
Given a graph where all edges have positive weights, the shortest path identified by Dijkstra's and Bellman Ford algorithm may be different but path weight would be same.
- ATRUE
- BFALSE
- Q48MCQ4 Marks·Choose one option

- A3, 5, 4, 10
- B3, 5, 5, 9
- C2, 5, 5, 10
- D2, 5, 4, 9
- Q49MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q50MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q51MCQ4 Marks·Choose one option

- A4
- B5
- C6
- D7
- Q52MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q53MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q54MCQ4 Marks·Choose one option

- AEdges {cd, bd}
- BEdges {cb, cd, bt}
- CEdges {ab, cd, cb}
- DEdges {bt, bd}
- Q55MCQ4 Marks·Choose one option

- AOnly statement 1 is correct
- BOnly statement 2 is correct
- CBoth the statements are correct
- DBoth the statements are wrong
- Q56MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q57MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q58MSQ4 Marks·Choose all correct options

- A17
- B37
- C62
- D57
- E82
- Q59MSQ4 Marks·Choose all correct options

- A23, 36, 72, 12, 54, 83
- B36, 72, 23, 54, 12, 83
- C36, 23, 72, 12, 83, 54
- D36, 23, 72, 12, 54, 83
- Q60MSQ4 Marks·Choose all correct options

- A1
- B5
- C3
- D4
- E6
- F7
- Q61MSQ4 Marks·Choose all correct options

- A2
- B3
- C4
- D5
- E9
- Q62MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- E

- F

- A
- Q63NAT4 Marks·Write the number
What is the maximum number of edges in a directed graph with 9 vertices?
Your answer: - Q64NAT4 Marks·Write the number
Your answer: - Q65NAT4 Marks·Write the number
What is the minimum possible height of a binary tree with 12 nodes (assuming the empty tree height is 0)?
Your answer: - Q66NAT4 Marks·Write the number
Your answer: - Q67NAT4 Marks·Write the number
Your answer:
Quiz 2 · 3 Aug 2025 (AN)Quiz 2
- Q68MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q69MCQ4 Marks·Choose one option

- A[12, 18, 20, 19, 32, 37, 27, 26, 29]
- B[12, 18, 20, 19, 32, 27, 37, 29, 26]
- C[12, 18, 19, 20, 27, 32, 37, 29, 26]
- D[12, 20, 18, 19, 32, 27, 37, 26, 29]
- Q70MCQ3 Marks·Choose one option
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?
- AStatements i and ii
- BStatements ii and iii
- CStatements i and iii
- DAll statements i, ii and iii
- Q71MCQ3 Marks·Choose one option

- A7
- B8
- C9
- D10
- Q72MCQ3 Marks·Choose one option

- A71
- B36
- C37
- D29
- Q73MCQ3 Marks·Choose one option
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.
- AStatements (i) and (ii) are false.
- BStatements (i) and (ii) are true.
- CStatement (i) is true and Statement (ii) is false.
- DStatement (i) is false and Statement (ii) is true.
- Q74MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q75MCQ3 Marks·Choose one option

- A328
- B82
- C100
- D126
- Q76MCQ3 Marks·Choose one option

- AA-3, B-1, C-2, D-4
- BA-4, B-1, C-3, D-2
- CA-4, B-1, C-2, D-3
- DA-1, B-3, C-2, D-4
- Q77MCQ3 Marks·Choose one option

- A15
- B9
- C14
- D17
- Q78MSQ3 Marks·Choose all correct options
Which of the following is/are True about Bellman-Ford algorithm?
- AIt can handle disconnected graphs.
- BThe shortest path is not stabilized, if there are negative cycles.
- CIt can handle negative edge weights, but not negative cycles.
- DIt uses the greedy approach to find the shortest path.
- Q79MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q80MSQ3 Marks·Choose all correct options
Which of the following statements are true about the finding the closest pair of points using divide and conquer strategy?
- A

- B

- C

- D

- A
- Q81NAT3 Marks·Write the number
Your answer: - Q82NAT3 Marks·Write the number
Your answer: - Q83NAT3 Marks·Write the number
Your answer:
End Term · 13 Apr 2025 (AN)End Term
- Q84MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q85MCQ4 Marks·Choose one option

- A2
- B3
- C4
- D5
- Q86MCQ4 Marks·Choose one option
What is the worst case time complexity of Selection Sort ?
- A

- B

- C

- D

- A
- Q87MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q88MCQ4 Marks·Choose one option
Consider a graph G with V vertices and E edges represented using an adjacency list. What is the worst case complexity for Breadth First Search?
- A

- B

- C

- D

- A
- Q89MCQ4 Marks·Choose one option

- A8
- B7
- C6
- D5
- Q90MCQ4 Marks·Choose one option

- A[41, 29, 26, 17, 15, 10, 9, 12, 11]
- B[41, 29, 26, 17, 15, 10, 9, 11, 12]
- C[41, 29, 26, 15, 17, 10, 9, 11, 12]
- D[41, 29, 26, 15, 17, 10, 9, 12, 11]
- Q91MCQ4 Marks·Choose one option
While inserting the elements [13, 7, 26, 33, 5, 10, 12, 11, 9] in an empty binary search tree (BST) in the sequence shown, the element at maximum depth is__.
- A33
- B9
- C11
- D5
- Q92MCQ4 Marks·Choose one option

- A1
- B2
- C3
- D4
- Q93MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q94MCQ4 Marks·Choose one option

- A8
- B6
- C4
- D2
- Q95MCQ4 Marks·Choose one option

- A5
- B6
- C7
- D8
- Q96MCQ4 Marks·Choose one option

- A4
- B5
- C11
- D12
- Q97MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q98MSQ4 Marks·Choose all correct options

- A22, 33, 44, 52, 26, 63
- B22, 26, 33, 44, 52, 63
- C26, 44, 33, 22, 52, 63
- D33, 44, 52, 22, 26, 63
- E44, 33, 52, 22, 26, 63
- Q99MSQ4 Marks·Choose all correct options
Which of the following statement is/are false?
- A

- B

- C

- D

- A
- Q100MSQ4 Marks·Choose all correct options
Which of the below statements are true about Dynamic programming?
- AIncreases both time complexity and space complexity.
- BIt replaces recursion with iteration, so there are no stack overflow errors.
- CIncreases time complexity and decreases space complexity.
- DIt avoids computing sub-problems more than once.
- Q101MSQ4 Marks·Choose all correct options
Which of these correspond to non-polynomial time complexity?
- A

- B

- C

- D

- E

- A
- Q102MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- E

- A
- Q103NAT4 Marks·Write the number
Your answer: - Q104NAT4 Marks·Write the number
Your answer: - Q105NAT4 Marks·Write the number
Your answer: - Q106NAT4 Marks·Write the number
Your answer: - Q107NAT4 Marks·Write the number
Your answer: - Q108NAT4 Marks·Write the number
Your answer:
Official KeyMaster Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Reveal KeyCollapse Key
Master Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.