Q. Which of the following problems should be solved using dynamic programming?

  • (A) mergesort
  • (B) binary search
  • (C) longest common subsequence
  • (D) quicksort
πŸ’¬ Discuss
βœ… Correct Answer: (C) longest common subsequence
Explanation: the longest common subsequence problem has both, optimal substructure and overlapping subproblems. hence, dynamic programming should be used the solve this problem.

Explanation by: Mr. Dubey
the longest common subsequence problem has both, optimal substructure and overlapping subproblems. hence, dynamic programming should be used the solve this problem.

πŸ’¬ Discussion

πŸ“Š Question Analytics

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