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.
- 16
- 50
- 120 min
- 12
- 3
- 1
Show answer
Correct answer
Question 2
Show answer
Correct answer
Question 3
Show answer
Correct answer
Question 4
Show answer
Correct answer
Question 5
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
Statement 1 and Statement 3 are false
Statement 2 and Statement 3 are false
Only statement 1 is false
Only statement 3 is false
Show answer
Correct answer
Only statement 3 is false
Question 6
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?
Show answer
Correct answer
Question 7
Only Statement 1 and Statement 3 are true
Only Statement 2 and Statement 3 are true
Only Statement 1 and Statement 2 are true
All statements are true
Show answer
Correct answer
All statements are true
Question 8
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?
Show answer
Correct answer
Question 9
Only statement 1 is true
Statement 1 and Statement 2 are true
Statement 1 and Statement 3 are true
Only statement 3 is true
Show answer
Correct answer
Statement 1 and Statement 3 are true
Question 10
Show answer
Correct answer
Question 11
Show answer
Correct answer
Question 12
12, 34, 9, 67, 4, 12
4, 12, 9, 67, 12, 34
4, 12, 67, 9, 12, 34
None of these
Show answer
Correct answer
4, 12, 9, 67, 12, 34
Question 13
51, 18, 45, 60, 34
18, 60, 45, 51, 34
18, 45, 34, 60, 51
34, 45, 18, 51, 60
Show answer
Correct answers
51, 18, 45, 60, 34
34, 45, 18, 51, 60
Question 14
Show answer
Correct answers
Question 15
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?
A B C D E F G
A B G C D E F
G A C F B D E
A G C B D F E
G A B D F C E
Show answer
Correct answers
A B G C D E F
A G C B D F E
G A B D F C E
Question 16
NOTE: Enter your answer to the nearest integer.
Show answer
Correct answer: 2
