GATE / CS ARCHIVE

GATE CSE 2015 SET 1 / QUESTION 13

GATE CSE 2015 Set 1 Q13

Algorithms · Other / Mixed Topics · Full GATE CSE 2015 Set 1 paper

GATE 2015 Set 1, Q13 1 mark · MCQ
Report issue

Other / Mixed Topics

Question 13, GATE 2015: Match algorithms P Prim MST, Q Floyd–Warshall all-pairs shortest paths, R mergesort, S Hamiltonian circuit search with i backtracking, ii greedy, iii dynamic programming, iv divide-and-conquer. A P-iii Q-ii R-iv S-i; B P-i Q-ii R-iv S-iii; C P-ii Q-iii R-iv S-i; D P-ii Q-i R-iii S-iv.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Prim greedily adds a cheapest edge crossing the current tree's cut. Floyd–Warshall builds shortest paths by increasing the allowed intermediate vertices, a dynamic-programming recurrence. Mergesort solves two smaller sorting problems and merges their answers. A standard Hamiltonian-circuit search tries vertices and abandons partial paths that cannot extend, illustrating backtracking.

Solution: Prim uses greedy selection; Floyd–Warshall uses dynamic programming; mergesort uses divide and conquer; the standard Hamiltonian-circuit search uses backtracking. Thus P-ii, Q-iii, R-iv, S-i, C.

Original paper, page 7 · Answer key