Back to the 2023 paper

Module 2: Fundamental Algorithmic Strategies

20237m

You are a thief planning to rob a jewelry store. The store contains 7 items, each with a profit PP and weight WW as follows:

Object 1 2 3 4 5 6 7
Profit (P) 5 10 15 7 8 9 4
Weight (W) 1 3 5 4 1 3 2

You have a knapsack with a weight capacity of 15. Apply the step-by-step greedy approach to obtain the maximum profit.

Similar questions