Skip to content
Advertisement

Tag: knapsack-problem

Using Knapsack approach without value?

Regarding to question, I am wondering that according to the following approach: Assume that there is no value and I am wondering that which approach or algorithm should be used for a Knapsack problem when the values are equal and there is a parameter (called n) that describes times for carrying items in a time? For example, the bag has

dp[!t][val] for skipping the parts from array

consider the following snippet in cpp. This is taken from dynamic programming tutorial . It is mainly for space optimized knapsack problem. This snippet is taken from this tutorial. I want to convert this technique into java. But java does not support this type of integer manipulation. Please can anyone explain me how it works and appropriate conversion to java

Advertisement