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