Question 1
a, b, c, d, e
a, b, c, e, d
a, b, d, c, e
a, b, d, e, c
The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) Quiz 2 paper sat on 3 Dec 2023, in the September 2023 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.
a, b, c, d, e
a, b, c, e, d
a, b, d, c, e
a, b, d, e, c
Correct answer
a, b, d, c, e
Let G = (V, E) be an undirected graph having distinct positive edge weights. Let V be partitioned into two non-empty sets X and Y. Let e = (s, t) be the minimum cost edge, with s belonging to X and t belonging to Y. Which of the following statement(s) is/are true?
1. The edge e must belong to each path from s to t.
2. The edge e must belong to the minimum cost spanning tree of G.
Only 1
Only 2
Both 1 and 2
Neither 1 nor 2
Correct answer
Only 2
[5, 6, 27, 10, 72, 29, 33, 65, 45]
[5, 6, 27, 10, 72, 33, 29, 45, 65]
[5, 6, 27, 72, 10, 33, 29, 45, 65]
[5, 6, 27, 10, 72, 33, 29, 65, 45]
Correct answer
[5, 6, 27, 10, 72, 33, 29, 65, 45]
Correct answer
Correct answer
15 bits
16 bits
17 bits
18 bits
Correct answer
17 bits
Select jobs with the earliest start times first.
Select jobs with the earliest end times first.
Select jobs with the shortest duration first.
Select jobs with the longest duration first.
Correct answer
Select jobs with the earliest end times first.
Correct answer
Correct answer
Correct answer: 12
Correct answer: 6
What is the maximum possible height of an AVL tree containing 15 nodes? Consider that an AVL tree with a single node has a height of 1.
Correct answer: 5
Dijkstra's algorithm computes the correct shortest path distance.
Dijkstra's algorithm does not compute the correct shortest path distance.
Bellman-Ford algorithm computes the correct shortest path distance.
Bellman-Ford algorithm does not compute the correct shortest path distance.
Floyd Warshall algorithm computes the correct shortest path distance.
Correct answers
Dijkstra's algorithm computes the correct shortest path distance.
Bellman-Ford algorithm computes the correct shortest path distance.
Floyd Warshall algorithm computes the correct shortest path distance.
Which of the following statements is/are true about min-heap with distinct elements?
The largest element in a min-heap is always at a leaf node.
The largest element in a min-heap is always at the lowest level.
The second-smallest element in a min-heap is always a child of the root node.
Finding the largest element in min-heap takes O(log n) time.
Correct answers
The largest element in a min-heap is always at a leaf node.
The second-smallest element in a min-heap is always a child of the root node.
A binary search tree is used to locate the number 43. Which of the following probe sequences of compared elements from the root to 43 is/are not possible?
2, 3, 50, 40, 60, 43
61, 52, 14, 17, 40, 43
10, 65, 31, 48, 37, 43
17, 77, 27, 66, 18, 43
Correct answers
2, 3, 50, 40, 60, 43
17, 77, 27, 66, 18, 43
Consider the following statements and choose the correct ones.
Correct answers