Concept Flow - Fractional Knapsack Problem
Start with empty knapsack
Sort items by value/weight ratio
For each item in sorted order
Can whole item fit?
No→Take fraction to fill knapsack
|Yes
Add whole item to knapsack
Knapsack full?
No→Next item
Yes
Done
We first sort items by their value per weight. Then we add whole items if they fit, or fractions if not, until the knapsack is full.
