DAA Test 1 2011

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Department of Information Technology

Minor Test (special classes) Design and Analysis of Algorithms


MM=30 Note : Solve any Time: 90 Min.

three questions. All questions carry equal marks.

Q1. A) What do you understand by stable sort? Name two stable sort algorithms. B) Prove that Bucket sort take (n) time.

Q2. Show that for any real constant a and b where b>0
(n+a)b= (nb) Q3. A) Illustrate the operation of Build Max-Heap on the array A=(27,17,3,16,13,10,1,5,7,12,4,8,9) B) What is the running time of quick sort when all the elements of array have the same values? Q4. Prove that the average case running time of quick sort is O(n log n) Q5. Can the Master Method be applied to the recurrence T(n)=4T(n/2)+n2lgn. Why or Why not?

Q6. There is a network given below as a highway map and the number recorded next to each arc as the
maximum elevation encountered in traversing the arc. A traveler plan to drive from node 1 to 12 on this highway. This traveler dislike high altitudes and so would like to find a path connecting node 1 to 12 that minimize the maximum altitude. Find the best path for the traveler using a minimum spanning tree (use both methods)

Q7. Design a greedy strategy for the following knapsack problem to find the optimal solution. Find an optimal solution to the knapsack instance n=7, m=15, (p1, p2..p7)=(10,5,15,7,6,18,3) and (w1,w2,w7)=(2,3,5,7,1,4,1) Q8. Find the shortest path for the following directed graph using Dijkstras Algorithm.

You might also like