Fractional Knapsack

About the algorithm:


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.
In the 0-1 Knapsack problem, we are not allowed to break items. We either take the whole item or don’t take it.


Time Complexity:O(nlogn)

Input:
Name Profit Weight
Output:
Your final knapsack contains:
Your final profit is: