Anda di halaman 1dari 2

_MCA32

USN

M S RAMAIAH INSTITUTE OF TECHNOLOGY (AUTONOMOUS INSTITUTE , AFFILIATED TO VTU) BANGALORE - 560 054

SEMESTER END EXAMINATIONS - JANUARY 2010


Course & Branch : Subject : Subject Code : Master of Computer Applications Semester: III Analysis and Design of Algorithms Max. Marks: 100 MCA32 Duration: 3 Hrs

Instructions to the Candidates: Answer one full question from each unit.

UNIT - I 1. a) What is an algorithm? With the help of an example show how a problem (10) may have several algorithms to solve it and same algorithm can be represented in different ways. b) What is meant by asymptotic notation? Explain. (6) c) order the following functions according to their order of growth (n-2)!, (4) 51g (3+100)10, 2zn, 0.001n4+3n3+1, In2n, 3,^n , 3n. 2. a) Explain the sequence of steps one goes through typically in designing and (10) analyzing an algorithm. b) Discuss the general plan for Analyzing efficiency of recursive algorithms (10) and use it to solve the time efficiency for the following algorithms (i) Towers of Hanoi (ii) recursive algorithm for determining the smallest element of an array. UNIT - II 3. a) Derive an algorithm for string matching using Brute force approach. (15) What are its best case and worst case efficiency? Estimate the number of comparisons required for string matching for the following pattern and text. Pattern -+ 1101011 Text - 110011011101101011000100 b) Give an example of a problem that uses exhaustive search to a (5) combinatorial problem and explain. 4. a) What do you mean by divide-and conquer technique for algorithm (12) design? How can this be used to solve the problem of sorting a set of values using Quick sort. Estimate the time efficiency. b) For the following sample use the Quick sort technique and sort it. (8) 5 19 2 6 14 12 52 48 34 96 UNIT - III 5. a) Explain the problem of Topological sorting. How can it be solved using (10) the Decrease and conquer technique? Suggest the two methods.

Page 1 of 2

MCA3 2
b) Use any algorithm for the following graphs and topologically sort them. (10)

6. a) What is a heap? Construct a heap for the list 1, 8, 6, 5, 3, 7, 4 by the (10) bottom-up algorithm and also by successive key insertions. b) Use the above instance for sorting the list using hen port using a (8) transform and conquer algorithm. c) What is the efficiency of heap-sort technique? (2) UNIT - IV 7. a) Apply Horspool's algorithm to search for the pattern BAOBAB in the text (10) BESS_KNEW_ABOUT_BAOBABS. b) Construct the shift table for the following gene sequence TCCTATTCTT. (10) Apply Horspool's algorithm to locate the pattern in TTATAGATCTCGTATTCTTTTATAGATCTCCTATTCTT. 8. a) Explain with the help of a greedy algorithm. How the shortest path (10) problem can be solved? b) What do you mean by open/closed hashing? Explain. (10) UNIT - V 9. a) With the help of branch-bound algorithm. Explain how the 0/1 knapsack (10) problem can be solved. b) Draw the state space tree for the following instance. (10) Item 1 2 3 4 Weight 10 7 8 4 Value $100 $63 _] $56 $12

W=16

10. a) Explain the back tracking technique of algorithm design and use it for (10) solving the 4 queens problem. b) Write short notes on P, NP and NP-complete problems. (10) **********************

Page 2 of 2

Anda mungkin juga menyukai