ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the time complexity of the brute force algorithm used to solve the Knapsack problem?
Correct Answer: C — O(2^{n})
In the brute force algorithm all the subsets of the items are found and the value of each subset is calculated. The subset of items with the maximum value and a weight less than equal to the maximum allowed weight gives the answer. The time taken to calculate all the subsets is O(2^{n}).