← Back to Algorithms

Fractional Knapsack

Maximizes the value of items in a knapsack where items can be broken into smaller pieces.

Time: O(n log n)
Space: O(1)

How it works