I am implementing a function with the following signature to solve the 0-1 knapsack problem in Haskell.
knapsack :: [Item] -> Capacity -> [Item]
If the Item and Capacity files are defined as:
type Value = Int type Weight = Int type Capacity = Int type Item = (Value, Weight)
I would like to remember it in order to have better results. I tried using Data.MemoCombinators , but I can't figure out how this works.
Can you give me some advice?
source share