4 ms·
That's not necessarily the case. For example: If you have 10[s] (units of space) in your knapsack, and you have 3 items in front of you the first with two with
by shliachtx 12y ago
That's not necessarily the case.
For example: If you have 10[s] (units of space) in your knapsack, and you have 3 items in front of you the first with two with 5[s] and 4[v] (units of value) each, and the third with 6[s] and 7[v], the best solution would be to take the first two, even though they have a lower [s]/[v] ratio, because you will end up with 1[v] more.
- hayksaakian 12y agoyou are correct, i was mistaken.