CMAACOR13T
CMAACOR13T
/CMAACOR13T/2022
(b) Prove that the worst case time complexity of bubble sort algorithm is O(n 2 ) .
3. (a) Define heap. What are the minimum and maximum number of elements in a heap 1+2+2+3
of height h?
(b) Is the sequence < 23; 17; 14; 6; 13; 10; 1; 5; 7; 12 > a heap?
(c) Sort the above sequence of elements using HeapSort algorithm.
4. (a) Write the Quick Sort algorithm to sort a list of integers in ascending order 5+3
considering the first element as the partitioning element.
(b) Find out the best case and worst case time complexity of the above algorithm.
5. (a) Compare Divide and Conquer and Dynamic Programming Methodologies. 4+4
(b) Write an algorithm to merge two sorted arrays into a single sorted array.
6. (a) Write Prim’s algorithm to find the minimum spanning tree of a given graph. 3+5
(b) Show the execution trace of the above algorithm for the following graph.
2
10 50
25
1 45
3
30
5 35
4 55
15
20
6
2 4
1 6
3 5
N.B. : Students have to complete submission of their Answer Scripts through E-mail / Whatsapp to
their own respective colleges on the same day / date of examination within 1 hour after end
of exam. University / College authorities will not be held responsible for wrong submission
(at in proper address). Students are strongly advised not to submit multiple copies of the
same answer script.
——×——
6036 2