Given items as {value,weight} pairs {{60,20},{50,25},{20,5}}. The capacity of knapsack=40. Find the maximum value output assuming items to be divisible and nondivisible respectively.

🎲 Try a Random Question  |  Total Questions in Quiz: 21  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Data Structures & Algorithms Practice Test: Greedy Algorithms — practice the complete quiz, review flashcards, or try a random question.

MCQs on fractional knapsack problem, activity selection problem and huffman code. A greedy algorithm is a technique for solving problems by making the best local choice at each stage. The goal is to find the best global solution.  Here are some examples of greedy algorithms: Knapsack problem: A well-known optimization problem that can be solved using a greedy method Spanning tree: A greedy algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph  Greedy algorithms are also known as approximation algorithms because they find a reasonable... Show more

Given items as {value,weight} pairs {{60,20},{50,25},{20,5}}. The capacity of knapsack=40. Find the maximum value output assuming items to be divisible and nondivisible respectively.