McqMate
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. |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet