why will the time complexity be O(N.2^N) for the brute force approach?
About the time complexity of the brute force approach of knapsack prblm
Hello @Senjuti256 This is because to work out all possible subsets ,then calc weight/values for each set), takes 2^N and then we calculate the sum of each subset of size from 1 to NN, that takes N⋅2^N.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.