Sie sind auf Seite 1von 2

For More Question Papers Visit - http://pediawikiblog.blogspot.

com

USN

I I I I I I I I I I I
Fourth Semester B.E. Degree Examination, June 2012 Design and Analysis of Algorithms

10CS43

Time: 3 hrs.

Max. Mark s: I 00

Note: Answer FIVE full questions, selecting at least TWO questions from each part.
PART-A If t1(n) E 0 (g 1 (n)) and t 2 (n) E 0(g 2 (n)), prove that t1( n) + t2( n) E O(max {g1(n). g2(n)} ). (06 Marks) If M(n) denotes the number of moves in tower of Hanoi puzzle when n disks are invo lved, give a recurrence relation for M(n) and solve this recurrence re lation. (07 Marks) Give an algorithm for selection so1t. If C(n) denotes the number of times the algorithm is executed (n denotes input size), obtain an express ion for C(n). (07 Marks)

a. b. c.

Assuming that n is a power of 2, solve the recurrence relation T(n) = 2T(n/2) + 2. Take T (2) = I and T( I ) = 0. (OS Marks) b. If nE l2k-l, 2k), prove that binary earch algorithm makes at most K element co mparisons for a successful search and either K - I or K comparisons for an unsuccessful search. (06 Marks) c. Give an algorithm for merge sort . (05 Marks) d. Consider the numbers given be low. Show how partition ing algorithm of qu ick sort will pl ace I 06 in its correct position. Show all the steps clearly. I 06 I 17 128 134 14 1 9 1 84 63 42. (04 Marks) a. a. Let J be a set of K jobs and cr = i1 , b. i3 , ........ ik be a permutation of jobs in J such that di1 :::; di2 :::; ....... :::; dik. Prove that J is a feas ible so lution if and o nly if the jobs in J can be processed in the order cr without violating any deadline. (07 Marks) b. Us ing Prim's algorithm, determine minimum cost spanning tree for the weighted graph (07 Marks) shown be low, fig.Q.3( b):

<!)

Fig.Q.3(b) c. In the weighted digraph given be low, fig.Q.3(c) determine the shortest paths from ve rtex (06 Marks) to all other vertices.

.),l:J

Fig.Q.3(c)

For More Question Papers Visit - http://pediawikiblog.blogspot.com

For More Question Papers Visit - http://pediawikiblog.blogspot.com

IOCS43
4

a. Obtain the shortest paths from every vertex to every other vertex in the diagraph given belo w; fig.Q.4(a) (10 Marks)

~ u~
b. F ig.Q.4(a) Using Warshall' s algorithm, obtain the transitive closure of the matrix given below: 0 I 0 0

R=

0 0 0

(10 Marks)

0 0 0 0 0 0

a. Show how insertion sort algorithm arranges the fo llowing members in increasing order. 6 1 28 9 85 34. (06 Marks)

b. Obtain topolog ical sorting

f t

PART-B

dia~wt

(06 Marks)

F ig. Q.5(b) c. Give algorithms for the follow ing: i) Comparison counting; ii) Distribution counting.
6

(08 Marks)

a. Define the follo wing: i) Tractable problems; ii) Class P; iii ) Class NP; iv) Polyno mial reduction; v) NP co mplete problems. (05 Marks) b. State subset sum problem. Using back tracking, obtain a so lution to the subset sum problem (07 Marks) by taking s = { 6, 8, 2, 14) and d = 16. c. Explain approx imation algorithms fo r NP - hard problems in general. Also discuss approximat ion algorithms for knapsack problem. (08 Marks) a. What is prefi x computation problem? G ive the algorithms for prefi x co mputation which uses i) n processors; ii) _n_ processors. Obtain the time complexities of these algorithms. log n
(10 Marks)

b. For an n x n matrix M with nonnegative integer coeffic ients. define M and give an algorithm for co mputing M . Prove that M can be computed fro m an n x n matrix M in O(log n) time using n3+ E co mmon CRCW PRAM processors for any fi xed E > 0. (10 Marks)

8 a. b. c. d.

Write short notes on: Traveling salesperson problem. Input enhancement in string matching. Dec isio n trees. Challenges of numerical algorithms.

(20 Marks)

*** For More Question Papers Visit * -* http://pediawikiblog.blogspot.com

Das könnte Ihnen auch gefallen