C. Application Based Questions:
1. Naman has to press two or three keys simultaneously to perform certain activities,
but he is finding it difficult to press these keys simultaneously. Is there certain way to
overcome this problem? If yes, elaborate.
(
dienai keyboard
Stiana na hali yake
Salon Bern
Answers
Answer:
Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy algorithms are used for optimization problems. An optimization problem can be solved using Greedy if the problem has the following property: At every step, we can make a choice that looks best at the moment, and we get the optimal solution of the complete problem.
If a Greedy Algorithm can solve a problem, then it generally becomes the best method to solve that problem as the Greedy algorithms are in general more efficient than other techniques like Dynamic Programming. But Greedy algorithms cannot always be applied. For example, Fractional Knapsack problem (See this) can be solved using Greedy, but 0-1 Knapsack cannot be solved using Greedy.