Time remaining:
Dynamic Programming

Computer Science
Tutor: None Selected Time limit: 0 Hours

I do not understand these two lines in the knapsack problem. Can someone break it down for me: m[i,w] = m[i-1, w]; if w sub i > w //line 1 m[i,w] = max(m[i-1,w], m[i-1, w - w sub i] + v sub i) if w sub i<= w //line 2 Does line one mean that the benefit of the first i items is the benefit of the first i-1 items? And what does line 2 mean?
Nov 20th, 2013
i can help you
Nov 20th, 2013

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Nov 20th, 2013
...
Nov 20th, 2013
Dec 8th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer