Nov Dec 2021
Nov Dec 2021
com
Reg. No. :
Third Semester
Give an algorithm that merges three sorted arrays A[l :m], B|l: n] and
C[1: k] and yields the output as a single sorted array having m+n+ k
elements.
www.lndianUniversityQuestion Papers.com
www.IndianUniversityQuestionPapers.com
PART B (5x 13 = 65 marks)
11. (a) (i) Find the time complexity of the below recurrence relation:
2T(n12) +1 if n>1
T)=1 otherwise
Or
(6)
12. (a) Devise an algorithm for Quick Sort and derive its time complexity. For
the above devised quick sort algorithm, derive the time complexity if all
the elements are arranged in ascending order. Illustrate a Recurrence
Tree for the same. (13)
Or
(b) Give an algorithm to find minimal cost spanning tree (MCST) using
prim's algorithm. Analyze its complexity by considering priority queue
implementation using mere sophisticated data structures. (13)
2 40030
www.lndianUniversityQuestionPapers.com
13. (a) Given an undirected weighted graph, devise an algorithm that finds all
pairs shortest path. What would the expected time complexity for your
algorithm? (13)
Or
(b) (i) Given an undirected unweighted graph (G) give algorithms that
perform Breadth First Search (BFS) and Depth First Search (DFS)
strategy to visit all the vertices of G. List down the order of visiting
the vertices in each traversal method. (10)
14. (a) () Design a Recursive algorithm (pseudocode) for solving 0/1 Knapsack
problem using backtracking approach. (6)
Or
15. (a) (i) Give a brief note about SAT and 3-8AT problems with example for
each. (7)
Or
(b) Outline the two broad categories of Randomized algorithms. Give a few
examples. Give an algorithmn that performs randomized quick sort by
considering an arbitrary element of an input array as the pivot element.
(13)
3 40030
www lndianlUniversityOuestionPaners com