Quiz Space

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

PDSA End Term: 3 September 2023, Set QPD1-S1 (May 2023 term)

The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) End Term paper sat on 3 Sept 2023, in the May 2023 term, set QPD1-S1: 26 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
26
Marks
100
Duration
180 min
MSQ
4
MCQ
13
Numerical
9

Updated

Official paper: IIT M DIPLOMA ET1 EXAM QPD1 S2 03 Sep · No negative marking.

Question 1

+4 marksOne or more correct options

Select all that apply.

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

Correct answers

  • B
  • C

Question 2

+4 marksOne or more correct options

Which of the following statement(s) is/are true?

Select all that apply.

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

Correct answers

  • A
  • B
  • C

Question 3

+4 marksOne or more correct options

Select all that apply.

  1. A

    coins = [6, 1, 5, 7] and x = 15

  2. B

    coins = [10, 1, 2, 5] and x = 25

  3. C

    coins = [1, 2, 8, 9, 5, 10] and x = 17

  4. D

    coins = [1, 5, 10, 25] and x = 30

  5. E

    coins = [1, 6, 10, 15] and x = 24

Show answer

Correct answers

  • C

    coins = [1, 2, 8, 9, 5, 10] and x = 17

  • E

    coins = [1, 6, 10, 15] and x = 24

Question 4

+3 marksOne or more correct options

Which of the following sorting algorithms will have the same time complexity irrespective of the sequence of elements in the input?

Select all that apply.

  1. A

    Selection Sort

  2. B

    Merge Sort

  3. C

    Quick Sort

  4. D

    Insertion Sort

Show answer

Correct answers

  • A

    Selection Sort

  • B

    Merge Sort

Question 5

+4 marksOne correct option

Which of the following statement(s) is/are correct with regard to the given Selection Sort? 1. Selection sort is stable sort.
2. It sorts In-place.
3. In Selection sort, after m passes through the list, the first m elements in the list are the m smallest element of the list.

  1. A

    Only statement 2 is true

  2. B

    Statement 1 and Statement 2 are true

  3. C

    Statement 2 and Statement 3 are true

  4. D

    Statement 1 and Statement 3 are true

  5. E

    All statements are true

Show answer

Correct answer

  • C

    Statement 2 and Statement 3 are true

Question 6

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

Correct answer

  • B

Question 7

+4 marksOne correct option
  1. A

    79, 22, 35, 15, 16, 77, 25

  2. B

    22, 35, 77, 16, 25, 79, 15

  3. C

    35, 16, 77, 15, 22, 25, 79

  4. D

    77, 79, 16, 35, 15, 22, 25

Show answer

Correct answer

  • D

    77, 79, 16, 35, 15, 22, 25

Question 8

+4 marksOne correct option

An airline serves 1000 cities and runs 4500 direct flights each day between these cities. Which of the following is a good data structure to get the list of cities where direct flight available from any particular cities?

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

Correct answer

  • D

Question 9

+4 marksOne correct option

Consider the following graph

If Dijkstra algorithm is used with A as the source vertex then what is the order in which all other vertices are visited?

  1. A

    A, B, E, D, F, C

  2. B

    A, B, D, E, C, F

  3. C

    A, B, E, D, C, F

  4. D

    A, B, D, E, F, C

Show answer

Correct answer

  • C

    A, B, E, D, C, F

Question 10

+4 marksOne correct option

The post-order traversal of a binary search tree with integer values produces the following sequence: 7, 5, 14, 12, 10, 20, 18, 25, 15. What is the value of the left child of the root of the tree?

  1. A

    14

  2. B

    12

  3. C

    10

  4. D

    7

  5. E

    18

Show answer

Correct answer

  • C

    10

Question 11

+4 marksOne correct option

If we do not maintain the height of subtrees at each node in an AVL tree, then what will be the upper bound of running time for inserting an element and balancing it if required?

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

Correct answer

  • B

Question 12

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

Correct answer

  • C

Question 13

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

Correct answer

  • D

Question 14

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

Correct answer

  • B

Question 15

+4 marksOne correct option
  1. A

    [0, 0, 1, 2, 1, 1, 2, 3]

  2. B

    [0, 0, 1, 1, 2, 1, 2, 0]

  3. C

    [0, 0, 1, 2, 0, 1, 2, 0]

  4. D

    [0, 0, 1, 1, 1, 0, 1, 2]

Show answer

Correct answer

  • C

    [0, 0, 1, 2, 0, 1, 2, 0]

Question 16

+3 marksOne correct option
  1. A

    1-d, 2-a, 3-c, 4-b

  2. B

    1-d, 2-b, 3-c, 4-a

  3. C

    1-d, 2-a, 3-d, 4-c

  4. D

    1-a, 2-d, 3-c, 4-b

Show answer

Correct answer

  • A

    1-d, 2-a, 3-c, 4-b

Question 17

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

Correct answer

  • C

Question 18

+4 marksNumerical answer

Consider the following DAG

How many possible topological orderings are there for the given DAG ?

Show answer

Correct answer: 6

Question 19

+4 marksNumerical answer

Consider the graph G given below.

The number of minimum cost spanning tree for the given graph is__.

Show answer

Correct answer: 2

Question 20

+4 marksNumerical answer

In a binary tree T of 25 nodes, if the number of nodes with two children is 6, then the number of nodes with one child is ___

Show answer

Correct answer: 12

Question 21

+4 marksNumerical answer
Show answer

Correct answer: 213

Question 22

+4 marksNumerical answer
Show answer

Correct answer: 55

Question 23

+4 marksNumerical answer
Show answer

Correct answer: 19000

Question 24

+4 marksNumerical answer
Show answer

Correct answer: 3

Question 25

+4 marksNumerical answer
Show answer

Correct answer: 22

Question 26

+3 marksNumerical answer

Let G be a graph. The size of the minimum vertex cover of G is 12 and the size of the maximum independent set of G is 17. What are the number of the vertices in graph G?

Show answer

Correct answer: 29