Algorithms

Fractional knapsack

A knapsack where you can take a piece of an item and earn the matching share of its value.

Example

If a 4 kg cheese is worth $12 and 1 kg is free, you take 1 kg and add $3.

Test yourself: Fractional knapsack

Fractional knapsack

In the fractional knapsack you can take a ___ of an item.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.