Machine-translated by Google. Questions are authored in English.
Top

Greedy and Divide and Conquer Questions and Answers

1.

Let C^(x) denote the ranking function that associates cost with a node in Branch and Bound Formulation of Travelling Salesperson Problem. What is the value of C^(x) for the root node for the following problem instance ?

1234
1∞3510
211∞68
3167∞20
4131210∞

Exam Year(s)

MH SET - 2020, SET Exam - 2020,

Answer: C

The root's cost is 31.

In the branch and bound TSP method, the root's lower bound is the total amount subtracted in reducing the cost matrix. Row minima: 3, 6, 7 and 10, total 26. After subtracting them the rows become (∞, 0, 2, 7), (5, ∞, 0, 2), (9, 0, ∞, 13) and (3, 2, 0, ∞).

Column minima of the reduced matrix: column 1 has 3, column 2 has 0, column 3 has 0 and column 4 has 2, total 5.

\[ \hat{C}(\text{root}) = 26 + 5 = 31 \]

26 is only the row reduction, without the column step. 29 and 36 come from arithmetic slips in the reductions.

Please log in or register to report this question.

2.

The technique that exploits the relationship between solution to the given instance of a problem and smaller instance of the same problem is known as :

Exam Year(s)

MH SET - 2021, SET Exam - 2021,

Answer: B

The technique is Decrease and Conquer.

Decrease and conquer, as Levitin defines it, exploits the relationship between the solution to a problem instance and the solution to a smaller instance of the same problem, solving the smaller one (top down or bottom up) and extending it. Insertion sort, binary search and Euclid's algorithm are examples, decreasing the size by a constant, by a constant factor or by a variable amount.

Divide and conquer splits a problem into several subproblems and combines their solutions. Transform and conquer changes the instance into a different, easier form, and dynamic programming stores the solutions of overlapping subproblems.

Please log in or register to report this question.

3.

The FFT (a) returns DFT (y). To compute inverse of DFT, FFT algorithm can be modified to :

(i) Switch the roles of a and y
(ii) Replace \(w_{n}\) by \(w_{n}^{-1}\)
(iii) Divide the final result by n

Exam Year(s)

MH SET - 2021, SET Exam - 2021,

Answer: D

All three modifications are needed, so the answer is (i), (ii) and (iii).

The DFT and its inverse are

\[ \begin{aligned} y_k &= \sum_{j=0}^{n-1} a_j\, \omega_n^{kj} \\ a_j &= \frac{1}{n} \sum_{k=0}^{n-1} y_k\, \omega_n^{-kj} \end{aligned} \]

Comparing the two, the inverse is the same computation with the roles of a and y switched (i), with \(\omega_n\) replaced by \(\omega_n^{-1}\) (ii), and with the result divided by n (iii). So the FFT computes the inverse DFT in \(\Theta(n \log n)\) time with all three changes; leaving out any one gives the wrong result.

Please log in or register to report this question.

4.

Match the algorithms in Group 1 with the design strategy used by the algorithm in Group 2

Group 1Group 2
P. Merge SortI. Greedy Strategy
Q. Insertion SortII. Dynamic Programming
R. Prim's algorithmIII. Divide and Conquer
S. Kruskal's algorithmIV. Decrease and Conquer

Exam Year(s)

MH SET - 2023, SET Exam - 2023,

Answer: D

The keyed answer is P→III, Q→IV, R→I, S→II.

  • Merge sort is divide and conquer: split, sort the halves, merge.
  • Insertion sort is decrease and conquer: sort n - 1 elements, then insert the last.
  • Prim's algorithm is greedy: it always adds the cheapest edge leaving the tree.

Kruskal's algorithm is in fact also greedy, adding the cheapest edge that does not form a cycle, so pairing it with dynamic programming is not accurate. But each strategy in Group 2 is used once, and option D is the only one that matches merge sort, insertion sort and Prim's algorithm correctly. Every other option already fails on these: A makes insertion sort dynamic programming, and B and C give merge sort the wrong strategy.

Please log in or register to report this question.

5.

The Merger sort algorithm employs the design technique :

Exam Year(s)

MH SET - 2024, SET Exam - 2024,

Answer: C

Merge sort uses divide and conquer.

It divides the array into two halves, sorts each half recursively, and merges the two sorted halves in linear time, giving \(O(n \log n)\) time.

It does not explore and undo choices (backtracking), it has no overlapping subproblems to store (dynamic programming), and it is far more efficient than trying all orderings (brute force).

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Greedy and Divide and Conquer Questions and Answers || Greedy and Divide and Conquer MCQ Questions and Answers || Greedy and Divide and Conquer GK Questions and Answers || Greedy and Divide and Conquer GK MCQ Questions || Greedy and Divide and Conquer Multiple Choice Questions and Answers || Greedy and Divide and Conquer GK || GK on Greedy and Divide and Conquer || Data Structures and Algorithms Questions and Answers || Data Structures and Algorithms MCQ Questions and Answers || Data Structures and Algorithms GK Questions and Answers || GK on Data Structures and Algorithms