Q.

Time complexity of fractional knapsack problem is                          

A. o(n log n)
B. o(n)
C. o(n2)
D. o(nw)
Answer» A. o(n log n)
Explanation: as the main time taking a step is of sorting so it defines the time complexity of our code. so the time complexity will be o(n log n) if we use quick sort for sorting.
1.1k
0
Do you find this helpful?
11

Discussion

No comments yet