A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage.[1] In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally optimal solutions that approximate a globally optimal solution in a reasonable amount of time.
Bibliography
“Greedy Algorithm.” 2022. Wikipedia, June. https://en.wikipedia.org/w/index.php?title=Greedy_algorithm&oldid=1094435998.