Earliest finish, largest reach, or smallest cost are different greedy rules.
Greedy
6 chapters · 9 challenges · The One-Way Steppe
Understand the idea, practise through play, then prove it in code. Choose your next quest below.
Visual introduction to this topic
What is a greedy algorithm?
A greedy algorithm commits to the best-looking valid choice now without revisiting earlier choices. It is correct only when a local choice can be proven to preserve some optimal solution.
Think of crossing stepping stones. Choosing the furthest safe stone works only if every shorter safe landing leaves no advantage that the long jump destroys.
A greedy move needs an exchange argument, not just a convincing example.
The choice must not block every optimal completion.
Show an optimal answer can adopt your choice without becoming worse.
Give each child the smallest sufficient gift
Exchange Argument
0/2 completePractice exchange argument through 2 visual expeditions.
Local Choice
0/2 completePractice local choice through 3 visual expeditions.
Scheduling
0/1 completePractice scheduling through 1 visual expedition.
Jump Reachability
0/2 completePractice jump reachability through 2 visual expeditions.
Partitioning
0/1 completePractice partitioning through 1 visual expedition.
Final challenge
0/1 completeCombine the skills from this world in a final challenge.
Built from authoritative material
This track is checked against the sources below. Visual traces still carry their own complete or guided coverage label, so unfinished explanations are not presented as complete executions.