Greedy Algorithm is used for optimization problems. It basically works by optimizing it's current move which result in a step towards the whole optimized problem or another way to get a bigger picture of this is, the algorithm takes baby steps that it feels is right for that specific move until it finds out the most optimal solution.When the step took turns out to be wrong, well it can't go back to have another shot at the problem. It has only and only 1 shot to make it right and can't reverse it's move. But still a lot of problems can be solved with the greedy approach.The method sates nothing but the given problem must be solved in stages or steps, and with each stage we further fetch an input from the problem and if it's a feasible solution then we can obviously include it in problem solution.We need do this until the problem input is exhausted and are left with our feasible solution.
for i from 1 to Size_Of_Problem
Input_From_Problem=Select(Problem_Array[i])
if Input_From_Problem is Feasible
Append this Solution to the existing one
Here I have added a lot of algorithms following the greedy paradigm. Feel free to explore more. ⭐