Algorithm Design and Analysis
SWE · Quiz · Spring 26
Paper 7 of 7By MAHMUDUL HASAN (3)Switch
Paper 7 of 7
Read the questions as text
Read off the PDF by AI, so it may have mistakes. The PDF is the original.
Class Test (Set 2)
Course Code: SE 214; Course Title: Algorithm Design and Analysis
Time: 30 Minutes
Marks: 15
1. You are managing a small logistics business and have a delivery truck that can carry a limited weight. You have several products that can be delivered, each with a weight and a profit.
Question: Given the following list of products:
Product A: Weight = 3, Profit = 10
Product B: Weight = 2, Profit = 7
Product C: Weight = 4, Profit = 12
Product D: Weight = 5, Profit = 15
If the truck has a weight capacity of 8, use greedy approach to find the maximum profit you can achieve. Which products should be selected?
2. For the coin denominations {1, 5, 10, 25}, explain how the greedy algorithm can be used to select minimum number of coins to meet 43.