Cse 5-3
Cse 5-3
Cse 5-3
)
Design & Analysis of Algorithms
P. Pages : 4 TKN/KS/16/7441
Time : Three Hours *0993* Max. Marks : 80
_____________________________________________________________________
Notes : 1. All questions carry marks as indicated.
2. Solve Question 1 OR Questions No. 2.
3. Solve Question 3 OR Questions No. 4.
4. Solve Question 5 OR Questions No. 6.
5. Solve Question 7 OR Questions No. 8.
6. Solve Question 9 OR Questions No. 10.
7. Solve Question 11 OR Questions No. 12.
8. Due credit will be given to neatness and adequate dimensions.
9. Assume suitable data whenever necessary.
10. Illustrate your answers whenever necessary with the help of neat sketches.
11. Use of non programmable calculator is permitted.
12. Diagrams and chemical equations should be given whenever necessary.
1. a) Solve the given recurrence using recursion tree method : 7
T(n ) 3 T n 4
n 2
0 if n 0 3
b) Solve the given recurrence: t n 5 if n 1
3
t n 1 4t n 2 Otherwise
c) Show that the lower bound for any sorting algorithm which does sorting by comparison of 4
keys is nlogn.
OR
2. a) Find the time complexity for the following segment of algorithms as a function of n: 5
i) l = o ;
for j = 1 to n do
{
For i = 1 to n2 do
{
For k = 1 to n3 do
{
l=l +1;
}
}
}
ii) l=o:
For i = 1 to n do
{
For i = i +2 to n do
{
For K = 1 to j – 1 do
{
l=l+1;
}
}
}
TKN/KS/16/7441 1 P.T.O
www.rtmnuonline.com
b) Define algorithm in detail. Explain their four distinct area of study. 5
c) Explain time complexity and space complexity with respect to any algorithm. 4
b) Explain the process of deleting a node from Fibonacci Heap structure. Draw the 7
modification if minimum value is deleted from the tree.
23 7 21 3 17 24
18 52 38 26 46
39 41 35
OR
b) Define three asymptotic notations find upper bound, lower bound and tight bound range 4
for the following.
i) 5n 11
ii) 21n 2 9n 6
iii) 53n n 3
5. a) What is minimum cost spanning tree? Using prim's algorithm find the minimum cost 9
spanning tree for the following graph. Discuss complexity of Prim's algorithm?
2
2 4
3
1
2
1 5
3 3 7
4
7 2
1 6 5
3
b) Explain Divide and Conquer strategy. Discuss best case, average case and Worst case 5
complexity of merge sort and quick sort.
OR
TKN/KS/16/7441 2
www.rtmnuonline.com
www.rtmnuonline.com
6. a) Write an recursive algorithm to implement merge sort technique. Derive its recurrence 8
relation and solve to obtain the complexity.
b) Give general characteristics of Greedy and Dynamic algorithm. Give greedy algorithm for 6
Knapsack problem Work out the algorithm step by step for the given problem and find out
the optimal solution:
Problem: Assume the maximum capacity of a Knapsack m = 20 n = 3,
(p1, p 2 , p3 ) (25,14, 15) and ( w1, w 2 , w 3 ) (15,18, 10) .
7. a) Write an algorithm for All Pairs shortest Path and generate a final matrix for the following 6
graph.
50
5
1 2
13
10 30 25
–5
4
4 3
17
b) Write a recurrence equation for LCS and Find LCS for the following sequences. 7
x A B R A C
y B A R A C
Write algorithm for the same.
OR
9. a) What is planner graph. Find solution space tree for colouring following graph. 7
1
2 3
4 5
TKN/KS/16/7441 3 P.T.O
www.rtmnuonline.com
www.rtmnuonline.com
b) What is Backtracking? Explain Implicit as well as Explicit constraints? Obtain the BFS tree 6
and DFS tree for following graph?
1
2 4
5 6
OR
10. a) What is biconnected graph? Explain and write algorithm for Hamiltonian cycle. For the 6
graph generate atleast two cycles.
1 2 3 4
8 7 6 5
b) Give two solution for 8-queen problem. Write algorithm for the same. Explain Implicit 7
and Explicit constraints.
OR
**********
TKN/KS/16/7441 4
www.rtmnuonline.com