Lesson 16: Greedy algorithms

A greedy algorithm is an approach for solving a problem by selecting the best option available at the moment. It doesn’t worry whether the current best result will bring the overall optimal result.

The algorithm never reverses the earlier decision even if the choice is wrong. It works in a top-down approach.

Open reading material (PDF)

MaxNonoverlappingSegments

Find a maximal set of non-overlapping segments.

Difficulty Level: Easy

TieRopes

Tie adjacent ropes to achieve the maximum number of ropes of length >= K.

Difficulty Level: Easy