What is the time complexity of the brute force algorithm used to solve the knapsack problem?
Answers
Answered by
0
Answer:
O(n!) is the time complexity of the brute force algorithm used to solve the knapsack problem
Explanation:
A bit string of 0's and 1's is produced which is of length n. In the event that the ith image of a bit string is 0, at that point the ith thing isn't chosen and in the event that it is 1, the ith thing is chosen.
#SPJ6
Answered by
0
Answer:
O(n!)
Explanation:
In the brute pressure set of rules all of the subsets of the gadgets are determined and the price of every subset is calculated. The subset of gadgets with the most price and a weight much less than same to the most allowed weight offers the answer. The time taken to calculate all of the subsets is O(2n).
#SPJ2
Similar questions
English,
7 months ago
Chemistry,
7 months ago
India Languages,
7 months ago
Political Science,
1 year ago
Science,
1 year ago