Reg. No. ________ Karunya University (Karunya Institute of Technology and Sciences) (Declared as Deemed to be University under Sec.3 of the UGC Act, 1956) Supplementary Examination – July 2010 Subject Title: Subject Code: INTRODUCTION TO ALGORITHMS CS259 Time: 3 hours Maximum Marks: 100 Answer ALL questions PART – A (10 x 1 = 10 MARKS) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. What is the worst case complexity of merge sort? What is the time complexity of Strassen’s matrix multiplication? Give an application of tree vertex splitting problem. What is shortest path spanning tree? What type of problem can be solved by dynamic programming? What is the technique used in the rabin karp algorithm? What is the time complexity of depth first search? What is worst case time for a back tracking algorithm? What are the search strategies in branch and bound method? What is distance matrix? PART – B (5 x 3 = 15 MARKS) 11. Write control abstraction for divide and conquer. 12. Draw a shortest path spanning tree from node 1 for the following graph. 13. Explain how boyer moore algorithm is used for string matching. 14. Write an algorithm for breadth first search. 15. Write UBound function for knapsack problem in branch and bound. PART – C (5 x 15 = 75 MARKS) 16. Write the partition method of QUICK SORT algorithm and derive its complexity. (OR) 17. Write a recursive algorithm to find Maximum and Minimum. Explain with an example. 18. a. b. 19. a. b. Let n =5 jobs , (p1,p2…p5) =(20,15,10,5,1) and (d1,…d5)= (2,2,1,3,3). Find the optimal solution and profit. (10) Write an algorithm for greedy strategies for knapsack problem. (5) (OR) 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). (10) Write Tree Vertex splitting algorithm (5) [P.T.O] 20. Write Multistage graph pseudocode corresponding to forward and back ward approaches. (OR) 21. Explain the knitter morris pratt algorithm with working example of the search algorithm. 22. Explain about graph coloring with an example. (OR) 23. Write recursive back tracing algorithm. Explain with an example. 24. Explain about LC search in branch and bound with a control abstraction. Give an example. (OR) 25. Explain the 1/0 knapsack problem in branch and bound method.