Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
19 views4 pages

Cse 5-3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

B.E. (Computer Science Engineering) Fifth Semester (C.B.S.

)
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

3. a) Explain the following amortized method in detail. 6


i) Aggregate method.
ii) Accounting method
iii) Potential method.

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

4. a) Explain bitonic sorting network for the following set of information 1, 5, 7, 2, 8, 6, 2, 9 6


Explain its advantages.

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

c) What is sorting network? Give advantages of sorting network. 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

8. a) Explain principle of optimality? Using principle of dynamic programming write recurrence 9


equation for chained matrix representation or multiplication and solve the given problem
A  5  13, B  13  7, C  7  89, D  89  3, E  3  59 .

b) Obtain shortest path using travelling salesman problem. 4


0 4 8 3
2 0 7 9
 
 4 11 0 8 
 8 4 6 0 

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.

11. a) Explain the following terms: 8


i) Non-deterministic algorithm.
ii) Decision and optimized problem.
iii) NP-Hard problem.
iv) NP-Complete problem.

b) Write algorithm for Non-deterministic sorting? 4

c) What do you mean by hard problem? 1

OR

12. a) Prove that P  NP . 3

b) Differentiate the following. 7


i) Deterministic and Non-deterministic polynomial time algorithm.
ii) Decision problems Vs optimization problems.

c) Explain polynomial time Algorithm. 3

**********

TKN/KS/16/7441 4

www.rtmnuonline.com

You might also like