Being greedy won‘t make you rich.



A very intuitive approach lies at the bottom of so called greedy algorithms: at every step of the problem, do what looks best at that moment. To imagine this, think about how you hand out change. First, you pick the most valuable coin that covers most of the amount. Then you pick the second largest valued coin of the remaining change. And so on. You‘ll most definitely be done faster than if you just started assembling random coins.

Greedy algorithms unfortunately only work for rather simple problems. Often it’s necessary to plan ahead more than just one step. When climbing a mountain for example, taking at every intersection the path with the steepest slope is a valid approach that will probably bring you to the top. However, by being greedy you can either miss better opportunities that would bring you to the top faster or end up never reaching the true highest point.