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.
- 15
- 50
- 120 min
- 8
- 5
- 2
Show answer
Correct answer
Question 2
Show answer
Correct answer
Question 3
Show answer
Correct answer: 4
Question 4
It is considered an unstable sorting algorithm.
It is considered a stable sorting algorithm.
It has the same time complexity irrespective of the sequence of elements in the input.
It is efficient for larger data sets.
It is sorted in place.
Show answer
Correct answers
It is considered an unstable sorting algorithm.
It has the same time complexity irrespective of the sequence of elements in the input.
It is sorted in place.
Question 5
Show answer
Correct answer
Question 6
Insert a new node at the beginning
Delete a node from the end
Insert a new node at the end
Delete a node from the beginning
Show answer
Correct answer
Delete a node from the end
Question 7
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?
Single stack
Two stacks
Single queue
Two queues
Show answer
Correct answer
Two queues
Question 8
Show answer
Correct answer
Question 9
Show answer
Correct answer
Question 10
Leaves the stack S unchanged
Reverses the order of the elements in the stack S
Swap the top and bottom element of the stack S, keeping the other elements in the same order
Empties the stack S
Show answer
Correct answer
Reverses the order of the elements in the stack S
Question 11
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?
(A, K)
(H, J)
(M, N)
(B, O)
(P, E)
(C, M)
Show answer
Correct answers
(H, J)
(M, N)
(P, E)
Question 12
Show answer
Correct answer: 4
Question 13
Show answer
Correct answer: 3
Question 14
Show answer
Correct answer: 9
Question 15
Consider the following Directed Acyclic Graph(DAG):
The number of possible topological order(s) for the given graph is_____________.
Show answer
Correct answer: 2
