Solving the popular knapsack problem with greedy Algorithm.
The greedy algorithm will select the item to be keep in bag based on their cost which is the product of weight and value of the item.
value Weight
item 1 90 10
item 2 100 20
item 3 120 30
bag capacity = 50
max value to be obtained = 270