• retagged by
827 views

1 Answer

0 0 votes
There is not a perfect way to solve o/1 KS optimization problem, it is quite intuitive.

You can use Table Method as usual or Tree method(Branch and bound) !!!

Well, you can improve the speed by solving such problems :)
Position:
Show:

Related questions

0 0 votes
1 1 answer
1.6k
1.6k views
ryandany07 asked Aug 18, 2022
1,647 views
int max(int a, int b) { return (a b) ? a : b; }// Returns the maximum value that can be// put in a knapsack of capacity Wint knapSack(int W, int wt[], int val[], int n){...
0 0 votes
0 0 answers
1.4k
1.4k views
VIKAS TIWARI asked Dec 13, 2017
1,407 views
Read the following statements about 0/1 Knapsack problem.(i) Time complexity of Knapsack is O(n* W) where W is the weight of the Knapsack and there are n items.(ii) Time ...
0 0 votes
1 1 answer
488
488 views
Shubham Sharma 2 asked Sep 9, 2025
488 views
Arrange the following steps in the correct order to solve the Knapsack problem using Dynamic Programming.Define the base case when the capacity is zero ($0$) or no items ...