Ads Mse2 QP
Ads Mse2 QP
1. a. List the min heap properties and insert the element ‘2’ into the [1] R CO3
following given min heap tree without violating min heap property.
b. How many ways a pivot element can be selected in the quick sort and [1] U CO3
also give the scenario for worst case time complexity of quick sort?
c. Illustrate the elementary intervals and sub-intervals for the given pair [1] U CO3
of integers a, b, c, d? Interval is a pair of integers [a, b] and [c, d] where
a= 10, b= 20, c= 15 and d= 25.
d. Explain Log-Structured-Merge (LSM) tree and find whether it is used [1] U_CRP CO4
for efficient range queries. If yes, Justify your answer.
e. Define directed and undirected graph? Give example for each of the [1] R CO4
graph.
f. Write the output for the given text using run length encoding? [1] U CO4
AAABBCCCCD
2. a. Choose the given array and find the element 50 using Fibonacci [4] Ap CO3
search? Construct the fibonacci numbers and show the last fibonacci
number considered for the given example. Give an algorithm for
Fibonacci search.
[i] 1 2 3 4 5 6 7 8 9 10 11
ar[i] 10 22 35 40 45 50 80 82 85 90 100
b. Develop the C code to sort elements using quick sort. Quick sort creates [4] Ap CO3
two arrays to hold elements less than the pivot element to left of pivot
& the elements greater than the pivot element to right of pivot and
then recursively sort the sub-arrays.
3. a. Build the minimum spanning tree using Prim’s algorithm and start [4] Ap CO4
with vertex 10 as the starting node. Give the order in which nodes are
visited and also calculate the minimum total weight.
b. Examine the string and the pattern given below. Apply Knuth Morris [4] An CO4
Pratt algorithm and analyze the time complexity for it.
String: a b c a b c d a b a b c d a b c d a b d e
Pattern: a b c d a b d
(OR)
c. Make use of Kosaraju’s algorithm and find strongly connected [4] Ap CO4
components of graph. Also find whether the given graph is strongly
connected graph.
d. Compare the Breadth First Search (BFS) and Depth First Search (DFS) [4] An CO4
in terms of the data structure used for the given graph.
(OR)
c. Develop the C program for Merge sort. The Merge sort algorithm is a [4] Ap CO3
sorting algorithm that is based on the Divide and Conquer paradigm.
In this algorithm, the array is initially divided into two equal halves
and then they are combined into a sorted manner.
d. Make use of adjacency matrix, adjacency list and simple graph to [4] Ap CO4
represent the following graph.