Concept Flow - Fractional Knapsack Problem
Start with items sorted by value/weight ratio
Initialize total weight = 0, total value = 0
For each item in sorted list
Can whole item fit?
No→Take fraction to fill knapsack
|Yes
Add full item weight and value
Update total weight and value
Knapsack full?
No→Next item
|Yes
Done
The algorithm sorts items by value per weight, then adds full or fractional items until the knapsack is full.
