What is the main difference between the greedy approach and dynamic programming in terms of usage?
From what I understand, the greedy method may provide an optimal solution in some situations, while dynamic programming is able to yield an optimal solution in others.
Thanks.