Computer Science, asked by karan7790, 11 months ago

What is the time complexity of the brute force algorithm used to solve the knapsack problem?

Answers

Answered by ShraddhaKhanna
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 vinod04jangid
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