Skip to main content
SWStudyWalks Search

Computer Science / Unit 3   CS 0138 short lesson, about 20 seconds

The Greedy Method

Captions available

The idea

A greedy algorithm builds one solution by repeatedly applying a simple rule selecting the next element for immediate benefit — one candidate built, never the whole space.

In practice

Packing a bag by always adding the item that fits best right now is greed as method.

Where people slip

Immediate benefit is the method's power and its blind spot.

Your place on the trail

Every lesson rests on earlier ones and opens later ones. Tap any to jump.

Something wrong in this lesson? Flag it  ·  Sources for Computer Science