function knapsack(items, max_weight)
best_value ← 0
for each candidate in power_set(items)
if total_weight(candidate) ≤ max_weight
if sales_value(candidate) > best_value
best_value ← sales_value(candidate)
best_candidate ← candidate
return best_candidate
Теоретический минимум по Computer Science. Все что нужно программисту и разработчику
·
Владстон Феррейра Фило