Quiz Space

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

PDSA Quiz 1: 29 October 2023 (September 2023 term)

The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 1 paper sat on 29 Oct 2023, in the September 2023 term: 15 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
15
Marks
50
Duration
120 min
MCQ
8
Numerical
5
MSQ
2

Updated

Official paper: IIT M DIPLOMA AN2 EXAM QPD2 29 Oct 2023 · No negative marking.

Question 1

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

Correct answer

  • B

Question 2

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

Correct answer

  • D

Question 3

+3 marksNumerical answer
Show answer

Correct answer: 4

Question 4

+3 marksOne or more correct options

Select all that apply.

  1. A

    It is considered an unstable sorting algorithm.

  2. B

    It is considered a stable sorting algorithm.

  3. C

    It has the same time complexity irrespective of the sequence of elements in the input.

  4. D

    It is efficient for larger data sets.

  5. E

    It is sorted in place.

Show answer

Correct answers

  • A

    It is considered an unstable sorting algorithm.

  • C

    It has the same time complexity irrespective of the sequence of elements in the input.

  • E

    It is sorted in place.

Question 5

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

Correct answer

  • C

Question 6

+3 marksOne correct option
  1. A

    Insert a new node at the beginning

  2. B

    Delete a node from the end

  3. C

    Insert a new node at the end

  4. D

    Delete a node from the beginning

Show answer

Correct answer

  • B

    Delete a node from the end

Question 7

+3 marksOne correct option

A doctor sees patients in his consulting room every evening. A certain number of appointments are given for each evening. Patients can also take a chance and come without an appointment. Appointments are not for a fixed time. The receptionist allows patients in to see the doctor in the order in which they arrive, with the provision that any patient with an appointment goes in before any patient without an appointment. What would be a good data structure for the receptionist to keep track of the waiting patients?

  1. A

    Single stack

  2. B

    Two stacks

  3. C

    Single queue

  4. D

    Two queues

Show answer

Correct answer

  • D

    Two queues

Question 8

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

Correct answer

  • B

Question 9

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

Correct answer

  • A

Question 10

+4 marksOne correct option
  1. A

    Leaves the stack S unchanged

  2. B

    Reverses the order of the elements in the stack S

  3. C

    Swap the top and bottom element of the stack S, keeping the other elements in the same order

  4. D

    Empties the stack S

Show answer

Correct answer

  • B

    Reverses the order of the elements in the stack S

Question 11

+4 marksOne or more correct options

Suppose we obtain the following DFS tree rooted at node A for an undirected graph with vertices {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P}.

Which of the following cannot be an edge/edges in the original graph?

Select all that apply.

  1. A

    (A, K)

  2. B

    (H, J)

  3. C

    (M, N)

  4. D

    (B, O)

  5. E

    (P, E)

  6. F

    (C, M)

Show answer

Correct answers

  • B

    (H, J)

  • C

    (M, N)

  • E

    (P, E)

Question 12

+4 marksNumerical answer
Show answer

Correct answer: 4

Question 13

+4 marksNumerical answer
Show answer

Correct answer: 3

Question 14

+3 marksNumerical answer
Show answer

Correct answer: 9

Question 15

+3 marksNumerical answer

Consider the following Directed Acyclic Graph(DAG):

The number of possible topological order(s) for the given graph is_____________.

Show answer

Correct answer: 2