1. Computer Science Engineering (CSE)
  2. Design and Analysis of Algorithms
  3. A greedy algorithm can be used to solve ...
Q.

A greedy algorithm can be used to solve all the dynamic programming problems.

A. true
B. false
Answer» B. false
Explanation: a greedy algorithm gives optimal solution for all subproblems, but when these locally optimal solutions are combined it may not result into a globally optimal solution. hence, a greedy algorithm cannot be used to solve all the dynamic programming problems.

Discussion