Computer Science - Algorithms - Greedy algorithms - Greedy Coin Machine

Visual coin-change machine. Student sets a target amount (slider 1-99 cents). Available coins: 25¢, 10¢, 5¢, 1¢. The greedy approach: always pick the LARGEST coin that fits! For 67¢: take 25¢ (left: 42¢) → take 25¢ (left: 17¢) → take 10¢ (left: 7¢) → take 5¢ (left: 2¢) → take 1¢ → take 1¢. Total: 6

Edodovivmagarwal
Computer Science - Algorithms - Greedy algorithms - Greedy Coin Machine
Log in

Preparing your experience...

Loading scripts and resources

Comments (0)

0/5000

Comments are reviewed before appearing publicly.

About this Experience

Computer Science - Algorithms - Greedy algorithms - Greedy Coin Machine

vivmagarwal
vivmagarwalJan 29, 2026

Description

Visual coin-change machine. Student sets a target amount (slider 1-99 cents). Available coins: 25¢, 10¢, 5¢, 1¢. The greedy approach: always pick the LARGEST coin that fits! For 67¢: take 25¢ (left: 42¢) → take 25¢ (left: 17¢) → take 10¢ (left: 7¢) → take 5¢ (left: 2¢) → take 1¢ → take 1¢. Total: 6

Details

Computer ScienceAlgorithmsClass 12, Class 12, Grade 12, A2 Level, DP Year 2

Engagement

11

Likes

0

Remixes

0

Comments