Skip to content

Commit

Permalink
Update 16.2.md
Browse files Browse the repository at this point in the history
Fix typo in 16.2-3
  • Loading branch information
im-adithya authored and Peng-Yu Chen committed Sep 23, 2021
1 parent 15925f2 commit 5daa587
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Chap16/16.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ For row $i$ column $j$, we decide whether or not it would be advantageous to inc
> Suppose that in a $0$-$1$ knapsack problem, the order of the items when sorted by increasing weight is the same as their order when sorted by decreasing value. Give an efficient algorithm to find an optimal solution to this variant of the knapsack problem, and argue that your algorithm is correct.
Suppose in an optimal solution we take an item with $v_1$, $w_1$, and drop an item with $v_2$, $w_2$, and $w_1 > w_2$, $v_1 < v_2$, we can substitude $1$ with $2$ and get a better solution. Therefore we should always choose the items with the greatest values.
Suppose in an optimal solution we take an item with $v_1$, $w_1$, and drop an item with $v_2$, $w_2$, and $w_1 > w_2$, $v_1 < v_2$, we can substitute $1$ with $2$ and get a better solution. Therefore we should always choose the items with the greatest values.
## 16.2-4
Expand Down

0 comments on commit 5daa587

Please sign in to comment.