Quiz Space

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

PDSA Quiz 1: 5 June 2022 (May 2022 term)

The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 1 paper sat on 5 Jun 2022, in the May 2022 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
12
MSQ
3
Numerical
1

Updated

Official paper: IIT M DIPLOMA QUIZ1 EXAM QPE1 05 Jun 2022 IBA · No negative marking.

Question 1

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

Correct answer

  • A

Question 2

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

Correct answer

  • B

Question 3

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

Correct answer

  • B

Question 4

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

Correct answer

  • C

Question 5

+3 marksOne correct option

Consider the following statements:
1. A single stack can be used to check whether a word is palindrome or not
2. A stack can be used to evaluate expressions.
3. The last element to be inserted into a stack will always be the last element to be taken out of the stack.
Choose the correct option regarding the given statements.
Note: A palindrome is a word that spells the same from both sides. Eg: radar

  1. A

    Statement 1 and Statement 3 are false

  2. B

    Statement 2 and Statement 3 are false

  3. C

    Only statement 1 is false

  4. D

    Only statement 3 is false

Show answer

Correct answer

  • D

    Only statement 3 is false

Question 6

+3 marksOne correct option

According to the conventional definition, an array is a fixed size data structure whose values are contiguously located in memory, whereas a linked list is a dynamic collection (size can change) of values that are not contiguously located in memory.
Considering the above definitions, if we use a Binary search algorithm to find a value from a linked list, then what would be the worst-case time complexity of Binary search?

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

Correct answer

  • C

Question 7

+3 marksOne correct option
  1. A

    Only Statement 1 and Statement 3 are true

  2. B

    Only Statement 2 and Statement 3 are true

  3. C

    Only Statement 1 and Statement 2 are true

  4. D

    All statements are true

Show answer

Correct answer

  • D

    All statements are true

Question 8

+3 marksOne correct option

Consider a connected, directed graph on which DFS is executed. Which of the following options are true regarding pre and post numbering used in the DFS algorithm on the graph?

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

Correct answer

  • B

Question 9

+3 marksOne correct option
  1. A

    Only statement 1 is true

  2. B

    Statement 1 and Statement 2 are true

  3. C

    Statement 1 and Statement 3 are true

  4. D

    Only statement 3 is true

Show answer

Correct answer

  • C

    Statement 1 and Statement 3 are true

Question 10

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

Correct answer

  • C

Question 11

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

Correct answer

  • D

Question 12

+4 marksOne correct option
  1. A

    12, 34, 9, 67, 4, 12

  2. B

    4, 12, 9, 67, 12, 34

  3. C

    4, 12, 67, 9, 12, 34

  4. D

    None of these

Show answer

Correct answer

  • B

    4, 12, 9, 67, 12, 34

Question 13

+3 marksOne or more correct options

Select all that apply.

  1. A

    51, 18, 45, 60, 34

  2. B

    18, 60, 45, 51, 34

  3. C

    18, 45, 34, 60, 51

  4. D

    34, 45, 18, 51, 60

Show answer

Correct answers

  • A

    51, 18, 45, 60, 34

  • D

    34, 45, 18, 51, 60

Question 14

+3 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 15

+3 marksOne or more correct options

Consider a DAG with V = {A, B, C, D, E, F, G}, shown below. Which of the following is/are valid topological orderings of the DAG?

Select all that apply.

  1. A

    A B C D E F G

  2. B

    A B G C D E F

  3. C

    G A C F B D E

  4. D

    A G C B D F E

  5. E

    G A B D F C E

Show answer

Correct answers

  • B

    A B G C D E F

  • D

    A G C B D F E

  • E

    G A B D F C E

Question 16

+4 marksNumerical answer

NOTE: Enter your answer to the nearest integer.

Show answer

Correct answer: 2