M

Mr. Dubey • 100.69K Points
Coach

Q. Fractional knapsack problem is solved most efficiently by which of the following algorithm?

  • (A) divide and conquer
  • (B) dynamic programming
  • (C) greedy algorithm
  • (D) backtracking
Share

Explanation by: Mr. Dubey
greedy algorithm is used to solve this problem. we first sort items according to their value/weight ratio and then add item with highest ratio until we cannot add the next item as a whole. at the end, we add the next item as much as we can.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics