1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. Time complexity of fractional knapsack p...
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.

Discussion