Skip to content

Enhancement of the knapsack algorithm #9266

@Jiang15

Description

@Jiang15

Feature description

There is a recursive implementation of 0-1 knapsack problem. The idea is to enhance it with code optimization and feature extension.

  • Optimize the recursion with memorization (DP) which reduces the complexity to O(KN).
  • Implement knapsack algorithm which gives the option to allow the items been repetitively picked multiple times, i.e, either 0-1 or 0-N knapsack problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions