Greedy Algorithm

Greedy algorithm uses computers to simulate the decision-making process of a "greedy" person. This person is very greedy, and every step he takes always chooses the best operation according to some indicator. Moreover, he is short-sighted and always only looks at the present, without considering the possible consequences in the future.

It is conceivable that the greedy method does not always obtain the optimal solution, so when generally using the greedy method, you must ensure that you can prove its correctness.