McqMate

Q. |
## A greedy algorithm can be used to solve all the dynamic programming problems. |

A. | true |

B. | false |

Answer» B. false | |

Explanation: 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. hence, a greedy algorithm cannot be used to solve all the dynamic programming problems. |

1.5k

0

Do you find this helpful?

13

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Suppose you have coins of denominations 1,3 and 4. You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm produce an optimal answer?
- The 0-1 Knapsack problem can be solved using Greedy algorithm.
- You are given infinite coins of N denominations v1, v2, v3,…..,vn and a sum S. The coin change problem is to find the minimum number of coins required to get the sum S. What is the time complexity of a dynamic programming implementation used to solve the coin change problem?
- Which of the following problems is NOT solved using dynamic programming?
- Which of the following problems should be solved using dynamic programming?
- The dynamic programming implementation of the maximum sum rectangle problem uses which of the following algorithm?
- Which of the following problems can be used to solve the minimum number of insertions to form a palindrome problem?
- In what time can the Hamiltonian path problem can be solved using dynamic programming?
- Which of the following algorithm can be used to solve the Hamiltonian path problem efficiently?
- What is the space complexity of the following dynamic programming implementation used to find the minimum number of jumps?