Skip to content

It is a classic dynamic programming problem in which we have to collect items in the knapsack in such a way that our profit is maximized. The difference between this problem and the fractional knapsack one is that you CANNOT take a fraction of an item.

Notifications You must be signed in to change notification settings

mehboobali98/Binary-Knapsack-Problem-DP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Knapsack Problem Dynamic Programming

It is a classic dynamic programming problem in which we have to collect items in the knapsack in such a way that our profit is maximized. The difference between this problem and the fractional knapsack one is that you CANNOT take a fraction of an item.

Approach

The algorithm to solve the problem has been implemented in three ways:

  • recursive
  • top-down
  • bottom-up (Dynamic Programming)

Time Complexity

The time complexity of the dynamic programming solution is: O(N^2)

Directory Structure

📦Binary-Knapsack-Problem-DP
┣ 📜main.cpp
┗ 📜README.md

About

It is a classic dynamic programming problem in which we have to collect items in the knapsack in such a way that our profit is maximized. The difference between this problem and the fractional knapsack one is that you CANNOT take a fraction of an item.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published