Concepts2
⚙️AlgorithmIntermediate
Exchange Arguments in DP
An exchange argument proves that any optimal solution can be reordered to satisfy a simple sorting rule by showing that swapping adjacent out-of-order elements never helps.
#exchange argument#adjacent swap#smith rule+12
⚙️AlgorithmIntermediate
Knapsack Problems
Knapsack problems ask how to pick items under a weight (or cost) limit to maximize value or to check if a target sum is reachable.
#0/1 knapsack#unbounded knapsack#bounded knapsack+12