You are given infinite coins of denominations 3, 5, 7. Which of the following sum CANNOT be achieved using these coins?
15
16
17
4
9 practice sets · Page 1 of 1
You are given infinite coins of denominations 3, 5, 7. Which of the following sum CANNOT be achieved using these coins?
15
16
17
4
You are given infinite coins of denominations 5, 7, 9. Which of the following sum CANNOT be achieved using these coins?
50
21
13
23
You are given infinite coins of denominations 1, 3, 4. What is the minimum number of coins required to achieve a sum of 7?
1
2
3
4
You are given infinite coins of denominations 1, 3, 4. What is the total number of ways in which a sum of 7 can be achieved using these coins if the order of the coins is not important?
4
3
5
6
Suppose 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 space complexity of a dynamic programming implementation used to solve the coin change problem?
O(N)
O(S)
O(N^{2})
O(S*N)
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?
O(N)
O(S)
O(N^{2})
O(S*N)
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?
14
10
6
100
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 NOT produce an optimal answer?
20
12
6
5
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 ____________
Greedy algorithm
Dynamic programming
Divide and conquer
Backtracking