Xiamen University Malaysia Tutorial Exercises
Algorithm Analysis and Design
Tutorial 12
1. Apply the bottom-up dynamic programming algorithm to the following
instance of the knapsack problem:
Item Weight Value
1 3 $25
2 2 $20
3 6 $5
4 4 $40
5 5 $45
Capacity W = 15.
Be sure to show the steps you took to solve the problem.
2. Implement the solution to the knapsack problem above.
Once you have completed the tutorial exercises, you may use the remaining of your tutorial
time to work on your Assignment.
Page 1 of 1