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

Hưng Thịnh

New member
A greedy algorithm can be used to solve all the dynamic programming problems.
A. True
B. False
 
Answer: B
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.
 

Tìm kiếm

Back
Top