✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
You have a knapsack of capacity C = 7 and the following items :
| Object | Weight (wi) | Value (vi) |
|---|---|---|
| 1 | 5 | 7 |
| 2 | 1 | 1 |
| 3 | 4 | 5 |
| 4 | 3 | 4 |
Question : What is the best combination of items that you can put in the knapsack without exceeding its capacity ?