-
-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Labels
AssignedIssue is assignedIssue is assignedHACKTOBERFESTThis issue is applicable for Hacktoberfest 2022This issue is applicable for Hacktoberfest 2022
Description
🔴 Title : Fractional Knapsack Problem using Python 3 language
🔴 Directory : Knapsack
🔴 Name : Abhishek Sharma
🔴 Contribution type :
- Hacktoberfest 2021
- Contributor
🔴 Approach : To solve this Fractional Knapsack problem, I will be using the Brute Force Method.
🔴 Problem Statement : Given weights and values of n items, we need to put these items in a knapsack of capacity W to get the maximum total value in the knapsack.
Input:
Items as (value, weight) pairs
arr[] = {{60, 10}, {100, 20}, {120, 30}}
Knapsack Capacity, W = 50;
Output:
Maximum possible value = 240
by taking items of weight 10 and 20 kg and 2/3 fraction
of 30 kg. Hence total price will be 60+100+(2/3)(120) = 240
@prathimacode-hub Please assign me this issue, I'll be contributing as a Hacktoberfest 2021 participant.
Metadata
Metadata
Assignees
Labels
AssignedIssue is assignedIssue is assignedHACKTOBERFESTThis issue is applicable for Hacktoberfest 2022This issue is applicable for Hacktoberfest 2022