A greedy algorithm makes the locally optimal choice at each step, hoping it leads to a global optimum. It is simple and fast, but only correct when the problem has the greedy-choice property and optimal substructure.
The idea
Never reconsider past choices — commit to the best immediate option and move on.
