Skip to content

Commit

Permalink
Update fractional-knapsack-algorithm.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-dhangar authored Nov 10, 2024
1 parent 4db85c1 commit fb01d0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/greedy-algorithms/fractional-knapsack-algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Space is required to store item information and ratios.
**Example:**
Consider a knapsack with a weight limit of W = 50 and the following items:

Items: {(value: 60, weight: 10), (value: 100, weight: 20), (value: 120, weight: 30)}
Sorted by ratio: {(value: 60, weight: 10), (value: 100, weight: 20), (value: 120, weight: 30)}
Items: `{(value: 60, weight: 10), (value: 100, weight: 20), (value: 120, weight: 30)}`
Sorted by ratio: `{(value: 60, weight: 10), (value: 100, weight: 20), (value: 120, weight: 30)}`
Step-by-Step Execution:

Add item with weight 10 (value-to-weight ratio 6):
Expand Down

0 comments on commit fb01d0b

Please sign in to comment.