🎒 Fractional Knapsack — Greedy
USACO C++ Book · Interactive Visualizer
🎒 Fractional Knapsack
Greedy
Value/Weight Ratio
Step 0/6
📊 Knapsack Filling
Item
Weight
Value
Ratio
Item1
10
60
6.0 ★
Item2
20
100
5.0
Item3
30
120
4.0
Knapsack (cap=50)
Item1(10)
Item2(20)
Item3(20)
Remaining: 50
Total Value
0
Current Item
—
→
sorted by ratio
🗂 Data Structure
Click Next Step to begin
💻 Code
Click Next Step to start
◀ Prev
Next Step ▶
↺ Reset
0/6
Keyboard:
→
Next
←
Prev
R
Reset