Quiz Space

September 2023 term · Programming, Data Structures and Algorithms using Python · BSCS2002

PDSA Quiz 2: 3 December 2023 (September 2023 term)

The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 2 paper sat on 3 Dec 2023, in the September 2023 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.

Questions
16
Marks
50
Duration
120 min
MCQ
9
Numerical
3
MSQ
4

Updated

Official paper: IIT M DIPLOMA AN2 EXAM QDD2 03 Dec 2023 · No negative marking.

Question 1

+3 marksOne correct option
  1. A

    a, b, c, d, e

  2. B

    a, b, c, e, d

  3. C

    a, b, d, c, e

  4. D

    a, b, d, e, c

Show answer

Correct answer

  • C

    a, b, d, c, e

Question 2

+3 marksOne correct option

Let G = (V, E) be an undirected graph having distinct positive edge weights. Let V be partitioned into two non-empty sets X and Y. Let e = (s, t) be the minimum cost edge, with s belonging to X and t belonging to Y. Which of the following statement(s) is/are true?
1. The edge e must belong to each path from s to t.
2. The edge e must belong to the minimum cost spanning tree of G.

  1. A

    Only 1

  2. B

    Only 2

  3. C

    Both 1 and 2

  4. D

    Neither 1 nor 2

Show answer

Correct answer

  • B

    Only 2

Question 3

+3 marksOne correct option
  1. A

    [5, 6, 27, 10, 72, 29, 33, 65, 45]

  2. B

    [5, 6, 27, 10, 72, 33, 29, 45, 65]

  3. C

    [5, 6, 27, 72, 10, 33, 29, 45, 65]

  4. D

    [5, 6, 27, 10, 72, 33, 29, 65, 45]

Show answer

Correct answer

  • D

    [5, 6, 27, 10, 72, 33, 29, 65, 45]

Question 4

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

Correct answer

  • D

Question 5

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

Correct answer

  • C

Question 6

+3 marksOne correct option
  1. A

    15 bits

  2. B

    16 bits

  3. C

    17 bits

  4. D

    18 bits

Show answer

Correct answer

  • C

    17 bits

Question 7

+3 marksOne correct option
  1. A

    Select jobs with the earliest start times first.

  2. B

    Select jobs with the earliest end times first.

  3. C

    Select jobs with the shortest duration first.

  4. D

    Select jobs with the longest duration first.

Show answer

Correct answer

  • B

    Select jobs with the earliest end times first.

Question 8

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

Correct answer

  • B

Question 9

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

Correct answer

  • A

Question 10

+4 marksNumerical answer
Show answer

Correct answer: 12

Question 11

+4 marksNumerical answer
Show answer

Correct answer: 6

Question 12

+3 marksNumerical answer

What is the maximum possible height of an AVL tree containing 15 nodes? Consider that an AVL tree with a single node has a height of 1.

Show answer

Correct answer: 5

Question 13

+3 marksOne or more correct options

Select all that apply.

  1. A

    Dijkstra's algorithm computes the correct shortest path distance.

  2. B

    Dijkstra's algorithm does not compute the correct shortest path distance.

  3. C

    Bellman-Ford algorithm computes the correct shortest path distance.

  4. D

    Bellman-Ford algorithm does not compute the correct shortest path distance.

  5. E

    Floyd Warshall algorithm computes the correct shortest path distance.

Show answer

Correct answers

  • A

    Dijkstra's algorithm computes the correct shortest path distance.

  • C

    Bellman-Ford algorithm computes the correct shortest path distance.

  • E

    Floyd Warshall algorithm computes the correct shortest path distance.

Question 14

+3 marksOne or more correct options

Which of the following statements is/are true about min-heap with distinct elements?

Select all that apply.

  1. A

    The largest element in a min-heap is always at a leaf node.

  2. B

    The largest element in a min-heap is always at the lowest level.

  3. C

    The second-smallest element in a min-heap is always a child of the root node.

  4. D

    Finding the largest element in min-heap takes O(log n) time.

Show answer

Correct answers

  • A

    The largest element in a min-heap is always at a leaf node.

  • C

    The second-smallest element in a min-heap is always a child of the root node.

Question 15

+3 marksOne or more correct options

A binary search tree is used to locate the number 43. Which of the following probe sequences of compared elements from the root to 43 is/are not possible?

Select all that apply.

  1. A

    2, 3, 50, 40, 60, 43

  2. B

    61, 52, 14, 17, 40, 43

  3. C

    10, 65, 31, 48, 37, 43

  4. D

    17, 77, 27, 66, 18, 43

Show answer

Correct answers

  • A

    2, 3, 50, 40, 60, 43

  • D

    17, 77, 27, 66, 18, 43

Question 16

+3 marksOne or more correct options

Consider the following statements and choose the correct ones.

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • A
  • B
  • C