Q.

The main time taking step in fractional knapsack problem is                        

A. breaking items into fraction
B. adding items into knapsack
C. sorting
D. looping through sorted items
Answer» C. sorting
Explanation: the main time taking step is to sort the items according to their value/weight ratio. it defines the time complexity of the code.
2.6k
0
Do you find this helpful?
39

Discussion

No comments yet