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
πŸ’¬ Discuss
βœ… Correct 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.

Explanation by: Mr. Dubey
the main time taking step is to sort the items according to their value/weight ratio. it defines the time complexity of the code.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
675
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
81%
Success Rate