McqMate

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

A. | dynamic programming |

B. | recursion |

C. | brute force |

D. | dynamic programming, recursion, brute force |

Answer» D. dynamic programming, recursion, brute force | |

Explanation: all of the mentioned methods can be used to solve the balanced partition |

820

0

Do you find this helpful?

7

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Given a rod of length n and the selling prices of all pieces smaller than equal to n, find the most beneficial way of cutting the rod into smaller pieces. This problem is called the rod cutting problem. Which of these methods can be used to solve the rod cutting problem?
- 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?
- 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?
- Given a 2D matrix, find a submatrix that has the maximum sum. Which of the following methods can be used to solve this problem?
- What is the time complexity of the brute force algorithm used to solve the balanced partition problem?
- 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)?
- The longest increasing subsequence problem is a problem to find the length of a subsequence from a sequence of array elements such that the subsequence is sorted in increasing order and it’s length is maximum. This problem can be solved using
- In which of the following cases, it is not possible to have two subsets with equal sum?
- 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?