PDSA End Term: 22 December 2024, Set QDF3 (September 2024 term)
The IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) End Term paper sat on 22 Dec 2024, in the September 2024 term, set QDF3: 25 questions for 100 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
- 25
- 100
- 180 min
- 18
- 6
- 1
Show answer
Correct answer
Question 2
Show answer
Correct answer
Question 3
Show answer
Correct answer
Question 4
55
58
60
48
Show answer
Correct answer
60
Question 5
0.5
0.33
0.17
0.83
Show answer
Correct answer
0.5
Question 6
Show answer
Correct answer
Question 7
Show answer
Correct answer
Question 8
Show answer
Correct answer
Question 9
Only 1
Only 2
Both 1 and 2
Neither 1 nor 2
Show answer
Correct answer
Only 1
Question 10
Only statement I is true
Only statement II is true
Both statements are true
Both statements are not true
Show answer
Correct answer
Only statement I is true
Question 11
Consider a complete binary tree with n nodes, where the left and the right subtrees of the root are min heaps. The upper bound to convert the tree to a min heap by an efficient algorithm is _______.
Show answer
Correct answer
Question 12
Which of the following statement(s) is/are correct about the traversals in a binary search tree? 1. The root of the tree is always the first element of the inorder traversal.
2. The root of the tree is always the last element of the postorder traversal.
Only statement 1 is correct
Only statement 2 is correct
Both the statements are correct
None of the statements are correct
Show answer
Correct answer
Only statement 2 is correct
Question 13
6
7
8
9
Show answer
Correct answer
9
Question 14
Show answer
Correct answer
Question 15
Show answer
Correct answer
Question 16
1000
1500
2000
2500
Show answer
Correct answer
1500
Question 17
A popular conference is being held, and there are several types of seats: VIP, Regular, and Economy. Each type of seat has a limited number of available spots. Each attendee has a preference for the type of seat they want, and the total number of attendees is greater than the number of available seats. The goal is to allocate the seats to attendees such that each attendee is assigned to their preferred seat type, and no seat type exceeds its capacity.
How can the given problem of allocating seats to attendees based on their preferences and seat type capacities be effectively solved?
Using a greedy algorithm to assign seats based on attendee preferences.
Modeling the problem as a maximum flow network with capacities representing seat limits and flows representing the number of attendees assigned to each seat type.
Implementing a first-come, first-serve approach without considering the preferences or seat type capacities.
Assigning all attendees to the VIP seats first and distributing the remaining attendees among Regular and Economy seats.
Show answer
Correct answer
Modeling the problem as a maximum flow network with capacities representing seat limits and flows representing the number of attendees assigned to each seat type.
Question 18
Consider the following statements.
1. If an NP-hard problem A is polynomial time reducible to another problem B, then B belongs to the class NP.
2. If an NP-hard problem A is polynomial time reducible to another problem B, then B is NP- complete.
Which of the following option is correct?
Only statement 1 is true
Only statement 2 is true
Both statements 1 and 2 are true
Both statements 1 and 2 are false
Show answer
Correct answer
Both statements 1 and 2 are false
Question 19
Show answer
Correct answer: 8
Question 20
Show answer
Correct answer: 20
Question 21
Show answer
Correct answer: 14
Question 22
Show answer
Correct answer: 4
Question 23
Show answer
Correct answer: 135
Question 24
Show answer
Correct answer: 10
Question 25
Show answer
Correct answers
