CS502 GDB Solution Spring 2020

Requirements:

Consider the scenario where you need to climb Margala Hills. You have a map pertaining multiple hiking trails like, trail 1, trail 2 etc. in order to reach at the top of hill. You have limited time and want an optimal choice to climb the hill without getting too much tired. You have the following three strategies in your toolkit to accomplish this task.

a) Dynamic programming
b) Greedy strategy
c) Divide and Conquer strategy

In the given scenario which strategy would be more appropriate and produce optimal solution, comment with proper reasons?

 

Solution:

a)  One prominent reason is to achieve the most feasible solution immediately. In the activity selection problem if more activities can be done before finishing the current activity, these activities can be performed within the same time.

b)  Another reason is to divide a problem recursively based on a condition, with no need to combine all the solutions.

c)   In the activity selection problem, the "recursive division" step is achieved by scanning a list of items only once and cons paring certain activities.

Previous Post Next Post