Given the weights and profits ofThe local optimal strategy is to choose the item that has maximum value vs weight ratio. This strategy also leads to a globally optimal solution because we are allowed to take fractions of an item.Nitems, in the form of{profit, weight}put these items in a knapsack of capacityNto get the maximum total profit in the knapsack.
|
Recursion
Recursion is one of the most important algorithms which uses the concept of code reusability and repeated usage of the same piece of code. |
|
|
The only thing worse than being talked about is not being talked about. — Oscar Wilde |