Which algorithm is best suited for solving the knapsack problem optimally?

18 views
  • Greedy
  • Backtracking
  • Dynamic Programming (Correct Answer)
  • Divide and Conquer

Explanation

Dynamic programming solves the knapsack problem by breaking it into subproblems and storing intermediate results. It ensures optimal solutions unlike greedy approaches which may fail for 0/1 knapsack.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs