Ads Mse2
Ads Mse2
1. a. Define Interval trees and mention the applications of interval [1] R CO3
tree.
b. Mention the max heap properties and insert the element ‘10’ into the [1] R CO3
following given max heap tree without violating max heap property.
16
12 9
Li Li
11 2
Li Li
c. Explain how the range queries are performed efficiently. To perform [1] U_CRP CO3
range queries efficiently what is the algorithms used.
d. Define graph and Find the in-degree and out-degree of each vertex [1] R CO4
for the given graph.
A B
D C
e. How run length encoding is calculated for the given text. Find the [1] R CO4
run length encoding for the text ‘BBBBCCCAAAAADD’ ?
f. Illustrate the construction of bad match table using the Booyer Moor [1] U CO4
algorithm for the given pattern P.
P: midexam
2. a. Develop an algorithm for quick sort. Assume the first element as the [4] Ap CO3
pivot element and sort the given numbers. In the first pass what is the
low and high values for the two sub arrays.
59, 69, 15, 72, 62, 45, 32, 89, 43, 36, 12, 90
b. Make use of the Trie data structure and insert the following words [4] Ap CO3
one after the other into the trie. After inserting all the words try to
delete last, call, map.
Cat
mat
c. Develop an algorithm for merge? Perform the merge sort on the given [4] Ap CO3
elements and show the step by step process.
59, 69, 15, 72, 62, 45, 32, 89, 43, 36, 12, 90
d. Make use of heap sort algorithm, arrange the following elements in [4] Ap CO3
descending order.
14, 45, 23, 78, 33, 23, 46, 56
3. a. Apply the graph representations on the following graph. A graph can be [4] Ap CO4
represented in various ways. Adjacency matrix or sequential
representation, Adjacency list and Adjacency multi-list or linked
representations are among them. Find these representations for the
following graph.
b. Examine the Knuth-Morris-Pratt (KMP) Algorithm to find whether 'P' [4] An CO4
occurs in 'T. 'For 'P' compute the prefix function. Given a string 'T' and
pattern 'P' as follows:
T:
a b a b c a b c a b a b a b d
P:
a b a b d
Examine the following graph and traverse this directed graph using
d. Breadth First Search(BFS) and Depth First Search (DFS). Compare both [4] An CO4
the techniques.
.
4. a. Make use of bitonic sequence and give the conditions to apply bitonic [4] Ap CO3
sort. Can we apply bitonic sequence on following numbers? If yes
apply bitonic sort on following numbers.
36, 46, 66, 86, 68, 50, 46, 26.
b. Construct prim's minimum spanning tree algorithm. Start Prim’s [4] Ap CO4
algorithm from vertex D for the graph given in the figure.
[i] 1 2 3 4 5 6 7
ar[i] 5 8 45 50 75 80 90
Make use of Kosaraju’s algorithm and find strongly connected [4] Ap CO4
d. components of following graph. Write the step by step procedure to
illustrate it.