Skip to content

Enhancement of the knapsack algorithm #9266

@Jiang15

Description

@Jiang15
Contributor

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.

Activity

balkishan69

balkishan69 commented on Oct 1, 2023

@balkishan69
abhishek09827

abhishek09827 commented on Oct 1, 2023

@abhishek09827
Jiang15

Jiang15 commented on Oct 1, 2023

@Jiang15
ContributorAuthor

I already created a PR here #9295

cclauss

cclauss commented on Oct 15, 2023

@cclauss
Member

CONTRIBUTING.md says:

Do not create an issue to contribute an algorithm. Please submit a pull request instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @cclauss@Jiang15@abhishek09827@balkishan69

      Issue actions

        Enhancement of the knapsack algorithm · Issue #9266 · TheAlgorithms/Python