- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- You are given infinite coins of N denomi...

Q. |
## 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? |

A. | o(n) |

B. | o(s) |

C. | o(n2) |

D. | o(s*n) |

Answer» D. o(s*n) | |

Explanation: the time complexity is o(s*n). |

View all MCQs in:
Design and Analysis of Algorithms

- You are given infinite coins of 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. This problem can be solved using
- You are given infinite coins of denominations 1, 3, 4. What is the minimum number of coins required to achieve a sum of 7?
- 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?
- What is the space complexity of the following dynamic programming implementation used to find the minimum number of jumps?
- What is the worst case time complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- You are given n dice each having f faces. You have to find the number of ways in which a sum of S can be achieved. This is the dice throw problem. Which of the following methods can be used to solve the dice throw problem?
- What is the time complexity of the above dynamic programming implementation of the assembly line scheduling problem?
- What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- Consider the brute force implementation in which we find all the possible ways of multiplying the given set of n matrices. What is the time complexity of this implementation?
- Given a string, you have to find the minimum number of characters to be inserted in the string so that the string becomes a palindrome. Which of the following methods can be used to solve the problem?

Login to Continue

It will take less than 2 minutes

Report MCQ