analysis & design of algorithms-jan10

Upload: yash-sharma

Post on 06-Apr-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Analysis & Design of Algorithms-Jan10

    1/2

    _MCA32L USN 1 M S 0

    MS RAMAIAH INSTITUTE OF TECHNOLOGY(AUTONOMOUS INSTITUTE , AFFILIATED TO VTU)

    BANGALORE - 560 054SEMESTER END EXAMINATIONS - JANUARY 2010

    Course & Branch : Master of Computer Applications Semester: IIISubject : Analysis and Design of Algorithms Max. Marks: 100Subject Code : MCA32Duaon 3HsInstructions 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 berepresented in different ways.b) What is meant by asymptotic notation? Expan. (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 smallestelement 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 ofcomparisons required for string matching for the following pattern andtext.Pattern -+ 1101011Text - 110011011101101011000100b) 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 ofvalues 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 96UNIT - 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

  • 8/3/2019 Analysis & Design of Algorithms-Jan10

    2/2

    MCA3 2b) 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 efficency of heap-sort technque? (2)

    UNIT - IV7. 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)Appy Horspoos agorithmto locate the pattern inTTATAGATCTCGTATTCTTTTATAGATCTCCTATTCTT.

    8. a) Explain with the help of a greedy algorithm. How the shortest path (10)problem can be solved?b) Wha doyoumeanby opencosed hashng?Expan (10)UNIT - V

    9. a) With the help of branch-bound algorithm. Explain how the 0/1 knapsack (10)problem can be solved.b) Drawthe state space tree for the folowng instance. (10)Item Weight Value

    1 10 $1002 7 $63 _] W=163 8 $564 4 $12

    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