McqMate

Q. |
## In which of the following cases, it is not possible to have two subsets with equal sum? |

A. | when the number of elements is odd |

B. | when the number of elements is even |

C. | when the sum of elements is odd |

D. | when the sum of elements is even |

Answer» C. when the sum of elements is odd | |

Explanation: when the sum of all the elements is odd, it is not possible to have two subsets with equal sum. |

703

0

Do you find this helpful?

1

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Given an array, check if the array can be divided into two subsets such that the sum of elements of the two subsets is equal. This is the balanced partition problem. Which of the following methods can be used to solve the balanced partition problem?
- In which of the following cases, the maximum sum rectangle is the 2D matrix itself?
- 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 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?
- Consider the 2×3 matrix {{1,2,3},{1,2,3}}. What is the sum of elements of the maximum sum rectangle?
- Consider the 2×2 matrix {{-1,-2},{-3,-4}}. What is the sum of elements of the maximum sum rectangle?
- What is the worst case time complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- What will be the auxiliary space complexity of dynamic programming solution of set partition problem(sum=sum of set elements)?
- 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?
- There are n dice with f faces. The faces are numbered from 1 to f. What is the minimum possible sum that can be obtained when the n dice are rolled together?