Question: what is the difference between greedy algorithm and dynamic programming?
Answer: The choice made by a greedy algorithm may depend on choices made so far but not on future choices or all the solutions to the subproblem. ... In other words, a greedy algorithm never reconsiders its choices. This is the main difference from dynamic programming, which is exhaustive and is guaranteed to find the solution.