https://github.com/bhargav-joshi/advanced-algorithms-problems
Advanced Algorithms Problems | Engineering
https://github.com/bhargav-joshi/advanced-algorithms-problems
all-pairs-shortest-path knapsack-problem lcs nqueens-problem
Last synced: 11 months ago
JSON representation
Advanced Algorithms Problems | Engineering
- Host: GitHub
- URL: https://github.com/bhargav-joshi/advanced-algorithms-problems
- Owner: bhargav-joshi
- Created: 2020-06-24T16:46:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-02T12:32:32.000Z (over 5 years ago)
- Last Synced: 2025-02-14T22:39:46.167Z (about 1 year ago)
- Topics: all-pairs-shortest-path, knapsack-problem, lcs, nqueens-problem
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advanced-Algorithms-Problems
Advanced Algorithms Problems | Engineering
[1]
### [0/1 Knapsack](https://github.com/bhargav-joshi/Advanced-Algorithms-Problems/blob/master/01knap.c)
* 0-1 Knapsack Problem comes under Dynamic Programming Approach (DP)
* A knapsack is a bag. And the knapsack problem deals with the putting items to the bag based on the value of the items. It aim is to maximise the value inside the bag. In 0-1 Knapsack you can either put the item or discard it, there is no concept of putting some part of item in the knapsack.
#### Easy Example :-

**Here you will learn about 0-1 knapsack problem in C.**
We are given n items with some weights and corresponding values and a knapsack of capacity W. The items should be placed in the knapsack in such a way that the total value is maximum and total weight should be less than knapsack capacity.
In this problem 0-1 means that we can’t put the items in fraction. Either put the complete item or ignore it. Below is the solution for this problem in C using dynamic programming.
[2]