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
Answer» C. greedy algorithm
Explanation: 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.
1.7k
0
Do you find this helpful?
18

Discussion

No comments yet