![]() ![]() Due to this, the time complexity is decreased but the space complexity is increased.ĩ. When a top-down approach of dynamic programming is applied to a problem, it usually _Ī) Decreases both, the time complexity and the space complexityī) Decreases the time complexity and increases the space complexityĬ) Increases the time complexity and decreases the space complexityĭ) Increases both, the time complexity and the space complexityĬlarification: The top-down approach uses the memoization technique which stores the previously calculated values. In dynamic programming, the technique of storing the previously calculated values is called _Ĭlarification: Memoization is the technique in which previously calculated values are stored, so that, these values can be used to solve other subproblems.Ĩ. Hence, a greedy algorithm CANNOT be used to solve all the dynamic programming problems.ħ. A greedy algorithm can be used to solve all the dynamic programming problems.Ĭlarification: A greedy algorithm gives optimal solution for all subproblems, but when these locally optimal solutions are combined it may NOT result into a globally optimal solution. So, dynamic programming saves the time of recalculation and takes far less time as compared to other methods that don’t take advantage of the overlapping subproblems property.Ħ. When dynamic programming is applied to a problem, it takes far less time as compared to other methods that don’t take advantage of overlapping subproblems.Ĭlarification: Dynamic programming calculates the value of a subproblem only once, while other methods that don’t take advantage of the overlapping subproblems property may calculate the value of the same subproblem several times. For example, mergesort uses divide and conquer strategy.ĥ. The optimal solutions are then combined to get a global optimal solution. If a problem can be solved by combining optimal solutions to non-overlapping problems, the strategy is called _Ĭlarification: In divide and conquer, the problem is divided into smaller non-overlapping subproblems and an optimal solution for each of the subproblems is found. If a problem can be broken into subproblems which are reused several times, the problem possesses _ property.Ĭlarification: Overlapping subproblems is the property in which value of a subproblem is used several times.Ĥ. If an optimal solution can be created for a problem by constructing optimal solutions for its subproblems, the problem possesses _ property.Ĭlarification: Optimal substructure is the property in which an optimal solution is found for the problem by constructing optimal solutions for the subproblems.ģ. Which of the following is/are property/properties of a dynamic programming problem?ĭ) Both optimal substructure and overlapping subproblemsĬlarification: A problem that can be solved using dynamic programming possesses overlapping subproblems as well as optimal substructure properties.Ģ. ![]() Data Structure Multiple Choice Questions on “Dynamic Programming”.ġ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |