uiz Space

January 2026 term · Programming, Data Structures and Algorithms using Python · BSCS2002

Programming, Data Structures and Algorithms using Python End Term: 10 May 2026, Set 1 (January 2026 term)

The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) End Term paper sat on 10 May 2026, in the January 2026 term, set 1: 24 questions for 100 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
24
Marks
100
Duration
180 min
Numerical
7
MCQ
12
MSQ
5

Updated

Official paper: Programming, Data Structures And Algorithms Using Python 10 May 26 · No negative marking.

Question 1

+4 marksNumerical answer

Consider the following function:

The function is called as:

How many recursive calls will be made by the function excluding the first main call?

Show answer

Correct answer: 4

Question 2

+4 marksNumerical answer

In a binary tree, suppose there are: 14 nodes with two children, and• 6 nodes with exactly one child.• How many leaf nodes does the tree have?

Show answer

Correct answer: 15

Question 3

+4 marksNumerical answer

While inserting the elements 50, 80, 20, 60, 10, 45, 65, 30, and 90 into an empty binary search tree (BST) in the sequence shown, the sum of elements at maximum depth is____.

Show answer

Correct answer: 95

Question 4

+4 marksNumerical answer

How many bits will be used to encode the message ABCDE using Huffman codes?

Show answer

Correct answer: 12

Question 5

+4 marksNumerical answer
Show answer

Correct answer: 10

Question 6

+4 marksNumerical answer
Show answer

Correct answer: 1500

Question 7

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 8

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
  5. E

    None of these

Show answer

Correct answer

  • D

Question 9

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 10

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 11

+4 marksOne correct option

Run DFS starting from vertex A. If multiple adjacent vertices exist, they are visited in alphabetical order.
Which of the following is the correct DFS traversal order?

  1. A

    A, B, D, E, C, F, G, H, I, J

  2. B

    A, B, C, H, J, G, D, E, F, I

  3. C

    A, B, C, H, J, G, E, D, F, I

  4. D

    A, B, C, D, E, F, G, H, I, J

Show answer

Correct answer

  • B

    A, B, C, H, J, G, D, E, F, I

Question 12

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 13

+4 marksOne correct option
  1. A

    33, 63

  2. B

    33, 127

  3. C

    7, 127

  4. D

    7, 63

Show answer

Correct answer

  • B

    33, 127

Question 14

+4 marksOne correct option

You are given the following list of 8 meeting requests with start time, and end time.

  1. A

    3

  2. B

    4

  3. C

    5

  4. D

    6

Show answer

Correct answer

  • A

    3

Question 15

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 16

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 17

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 18

+5 marksOne or more correct options

Which of the following could be possible insertion orders that produce the above hash table?

Select all that apply.

  1. A

    24, 35, 60, 48, 71, 14

  2. B

    60, 48, 71, 14, 24, 35

  3. C

    60, 48, 71, 24, 35, 14

  4. D

    24, 35, 71, 48, 60, 14

Show answer

Correct answers

  • A

    24, 35, 60, 48, 71, 14

  • C

    60, 48, 71, 24, 35, 14

Question 19

+5 marksOne or more correct options

A data science bootcamp offers 6 learning modules. Students must complete modules according to the prerequisite structure shown below.

A valid completion order must satisfy all prerequisite constraints.
Which of the following can be valid orders in which the modules are completed?

Select all that apply.

  1. A

    1, 2, 3, 4, 5, 6

  2. B

    1, 3, 2, 4, 5, 6

  3. C

    1, 2, 4, 5, 3, 6

  4. D

    1, 3, 5, 2, 4, 6

Show answer

Correct answers

  • A

    1, 2, 3, 4, 5, 6

  • B

    1, 3, 2, 4, 5, 6

Question 20

+5 marksOne correct option

Consider the following graph.

Suppose Dijkstra’s algorithm is executed with vertex 0 as the source vertex.
Which of the following is the correct order in which vertices are marked as visited by Dijkstra’s algorithm?

  1. A

    0, 2, 1, 3, 4, 5

  2. B

    0, 1, 2, 3, 5, 4

  3. C

    0, 2, 3, 1, 5, 4

  4. D

    0, 2, 1, 3, 5, 4

Show answer

Correct answer

  • D

    0, 2, 1, 3, 5, 4

Question 21

+4 marksOne or more correct options

Which of the following is/are always true about the Floyd-Warshall algorithm?

Select all that apply.

  1. A
  2. B
  3. C

    It works correctly if the graph has negative edge weights but does not have negative weight cycles.

  4. D
Show answer

Correct answers

  • A
  • C

    It works correctly if the graph has negative edge weights but does not have negative weight cycles.

Question 22

+4 marksOne or more correct options

Consider the graph G given below.

Let Minimum Spanning Trees (MSTs) of the graph be constructed using algorithms such as Kruskal’s or Prim’s algorithm.
Which of the following statements are correct?

Select all that apply.

  1. A

    The total weight of MST is 12

  2. B

    The number of distinct MSTs in the graph is 2

  3. C

    The edge (d, f) will be part of every MST

  4. D

    The edge (b, c) will be part of every MST

  5. E

    The edge (b, d) will be part of every MST

Show answer

Correct answers

  • A

    The total weight of MST is 12

  • B

    The number of distinct MSTs in the graph is 2

  • C

    The edge (d, f) will be part of every MST

Question 23

+4 marksOne or more correct options

Let C be a problem that belongs to the class NP. Which of the following statement(s) is/are TRUE?

Select all that apply.

  1. A

    If C is NP-Hard, then it is NP-complete.

  2. B

    There is no polynomial-time algorithm for C

  3. C

    If C can be solved in polynomial time, then P = NP.

  4. D

    If every problem in NP is reducible to C in polynomial time, then C is NP- complete.

Show answer

Correct answers

  • A

    If C is NP-Hard, then it is NP-complete.

  • D

    If every problem in NP is reducible to C in polynomial time, then C is NP- complete.

Question 24

+5 marksNumerical answer
Show answer

Correct answer: 40