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

Greedy and Divide and Conquer Questions and Answers

11.

The greedy (approximation) vertex cover problem is a

Exam Year(s)

Tripura Public Service Commission - 2019,

Answer: A

It is a 2-approximation problem.

The standard approximation algorithm picks any remaining edge (u, v), puts both u and v in the cover, deletes every edge touching them, and repeats. The edges it picks share no vertices, and any vertex cover must contain at least one end of each of them, so the cover it builds is at most twice the size of the optimum.

The ratio 2 is tight, so the algorithm is classed as a 2-approximation. A bound of 3 is weaker and not how it is described, which rules out the 3-approximation and 'Both' options.

Please log in or register to report this question.

12.

_________ comparisons are necessary in the worst case to find both the maximum and minimum of n numbers.

Exam Year(s)

UGC NET - 2013,

Answer: C

The number of comparisons needed in the worst case to find both the maximum and the minimum of n numbers is about \(\lceil 3n/2 \rceil - 2\), and option C is the closest listed form. Pair the elements, compare each pair (n/2 comparisons), then find the maximum among the winners and the minimum among the losers (about n/2 - 1 each).

\(2n - 2\) is what the naive method needs, \(n + \lfloor \lg n \rfloor - 2\) is the bound for finding the two largest elements, and \(2 \lg n - 2\) is too small to be possible.

Please log in or register to report this question.

13.

Let A and B be two \(n \times n\) matrices. The efficient algorithm to multiply the two matrices has the time complexity

Exam Year(s)

UGC NET - 2013,

Answer: B

The efficient algorithm for multiplying two \(n \times n\) matrices listed here has complexity \(O(n^{2.81})\), which is Strassen's algorithm. It uses 7 multiplications of half-size matrices instead of 8, giving \(O(n^{\log_{2} 7}) = O(n^{2.81})\).

\(O(n^{3})\) is the ordinary method, so it is not the efficient one. \(O(n^{2.67})\) is not a known result in this list, and \(O(n^{2})\) is the trivial lower bound, which no known algorithm achieves.

Please log in or register to report this question.

Loading…
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