Show the worked solutiona. Bucket sort on uniformly distributed input runs in \(O(n)\) expected time, so a-iv.b. Matrix-chain multiplication by dynamic programming fills \(O(n^2)\) entries, each in \(O(n)\): \(O(n^3)\), so b-ii.c. Huffman coding with a min-priority queue does \(n-1\) merges of \(O(\lg n)\) each: \(O(n\lg n)\), so c-iii.d. All-pairs shortest paths by repeated squaring of the distance matrix: \(\lg n\) products of \(O(n^3)\) each, \(O(n^3\lg n)\), so d-i.The code a-iv, b-ii, c-iii, d-i is option C.Answer: C
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com