0% found this document useful (0 votes)
20 views

Cse 5

The document is an exam for a fifth semester computer science and engineering course on design and analysis of algorithms. It contains 12 questions covering topics like solving recurrences, analysis of sorting algorithms, graph algorithms, and dynamic programming. Students are instructed to choose one question from each pair to answer for a total of 6 questions.

Uploaded by

Riya Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Cse 5

The document is an exam for a fifth semester computer science and engineering course on design and analysis of algorithms. It contains 12 questions covering topics like solving recurrences, analysis of sorting algorithms, graph algorithms, and dynamic programming. Students are instructed to choose one question from each pair to answer for a total of 6 questions.

Uploaded by

Riya Patil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

www.rtmnuonline.

com

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


Design and Analysis of Algorithms
P. Pages : 3 KNT/KW/16/7353
Time : Three Hours *0658* 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. Assume suitable data whenever necessary.
9. Illustrate your answers whenever necessary with the help of neat sketches.

1. a) Solve the following equation by using characteristic equation

om
7
t n  n , if n = 0 or n = 0 or n = 2

e.c
 5 t n 1  8 t n  2  4 t n 3 , otherwise.

lin
on
nu
b) Prove that 4

m
.rt
n
 log (i)  0 (n log n ) w
w
i 1
w

c) Show that 3
log !  0 (n log n)
OR
om
e.c

2. a) Use Master Method to give tight asymptotic bound for the following recurrence. 8
lin

 2  n 3
T ( n )  4T n
on

i)
nu

T(n )  T 9n  n
m
.rt

ii) 10
w
w
w

b) Explain principles of designing algorithms. 6

3. a) What is amortized complexity? Find potential candidates for four bit binary incrementor 6
ranging from 0 to 8.

b) Give Stepwise operation of Heap sort on following input array & also explain the 7
complexity of heap sort.
A  4, 8, 20, 17, 7, 25, 2, 13, 5
OR

4. a) What is sorting network? Design a 8 bit bitonic sorting Network and explain its operation 7
for 1, 3, 5, 9, 8, 7, 4, 2

b) Explain worst case and average case analysis with example. 6

KNT/KW/16/7353 1 P.T.O

www.rtmnuonline.com
www.rtmnuonline.com

5. a) Find out average number of comparisons required for successful and unsuccessful binary 6
search on following array.
-12, 23, 31, 45, 56, 78, 90, 103, 113, 126, 157

b) Write an algorithm for evaluation of partial knapsack. Find the optimal solution for the 7
following partial knapsack instance.
n  4, M  11
w  (1, 2, 5, 8, 7)
p  (1, 6,18, 25, 30)

OR

6. What is Minimum Cost Spanning tree? Write an algorithm for Prim's method for finding 13
the minimum cost spanning tree. Also discuss its complexity solve the following using
Prim's Algorithm.
5

om
1 8

e.c
9 27

lin
4
2

on
6
14

nu
16

m
25 7

.rt
22 1
w
w
5 3
18
w

24 12
4

7. a) Write algorithm to generate LCS - Matrix and Print - LCS Implement the algorithm on 8
following strings to construct LCS matrix.
om

String A = 101101101
e.c

String B = 0101101
lin
on

b) What is travelling salesman problem? Implement TSP for the following matrix 6
nu

representing complete graph.


m
.rt
w

0 10 15 20
w
w

5 0 9 10
6 13 0 12
8 8 9 0

OR

8. a) For the following set of keys implement optimal Binary search tree. Draw the tree and 8
find the cost of tree.
i 0 1 2 3 4 5
Pi -- 0.08 0.05 0.12 0.20 0.10
Pj 0.05 0.11 0.05 0.11 0.10 0.04

b) Write the algorithm to implement backward approach on multistage graph. Comment on 6


the complexity of the algorithm.

KNT/KW/16/7353 2

www.rtmnuonline.com
www.rtmnuonline.com

9. a) Design a solution for Hamiltonian path, explain how the solution can be used to solve 6
Hamiltonian cycle problem.

b) What is Planner graph? Implement graph colouring on following graph and generate 7
solution space tree.

B F

C E

om
OR

e.c
lin
10. a) Write an algorithm to solve n - queen problem. Explain implicit & explicit constraints 8

on
associated with 8 queen problem. Give at least two solutions for 8 queen problem.

nu
m
Explain sum of subset problem. Let n = 4, M = 18 & S   6, 4, 8, 7 find all possible
.rt
b) w
w 5
subset that sum to M.
w

11. a) Prove that P  NP . 3

b) Write algorithm for non - deterministic sorting. 4

c) Explain 3 classes of problems class P, class NP, class NP - complete with suitable 6
om

example.
e.c
lin

OR
on
nu
m

12. a) Using Reduction write algorithm for clique and modify it to solve graph partitioned into 7
.rt

triangle and independent set problem.


w
w
w

b) Write a short note on :

i) Decision and optimization problem. 3

ii) Polynomial reduction. 3

***********

KNT/KW/16/7353 3 P.T.O

www.rtmnuonline.com
www.rtmnuonline.com

om
e.c
lin
on
nu
m
.rt
w
w
w
om
e.c
lin
on
nu
m
.rt
w
w
w

KNT/KW/16/7353 4

www.rtmnuonline.com

You might also like