knapsack function

knapsack problem

knapsack problem

Solve a simple knapsack problem (Goal is to maximize the profit)

knapsack(n, capacity, profit, size)

Arguments

  • n: number of items
  • capacity: total capacity of carrying weight
  • profit: profit corresponding to each item
  • size: weight/size of each item
  • Maintainer: Akshit Achara
  • License: Mozilla Public License Version 2.0
  • Last published: 2021-10-15