MODEL QUESTION PAPER
Fourth Semester B.E. Degree Examination, June/July 2008
CS/IS
Analysis and Design of Algorithms
Time : 3 hours Max Marks:100
Note: Answer atleast two full questions from each part.
PART -A
1. a) Explain the Notion of algorithm and its important characteristics with the help of an algorithm. (06 Marks)
b) Write an algorithm to check whether the given number is an Armstrong number or not.(Ex: 13+53+33=153) (06 Marks)
c) Briefly explain the following terms- (08 Marks)
i) Dictionary ii) Stable algorithm iii) ADT iv) First child next sibling representation of trees
2. a) Explain the various asymptotic notations with examples. (08 Marks) b) Use the informal definitions of O, Ω, θ to determine whether the following assertions are true or false. (06 Marks) i) n(n+1)/2 € O(n3) ii)n(n+1)/2 € O(n2) iii) n(n+1)/2 € θ (n3) iv) n(n+1)/2€ Ω (n)
c) Discuss the algorithm for element uniqueness problem for its
Efficiency. (06 Marks)
3. a) Explain selection sort algorithm and its efficiency. (08 Marks) b) Discuss the merge sort algorithm with recursive tree and its efficiency. Apply the same algorithm to sort the list {4,6,1,3,9,5,2,7}. (12 Marks)
4. a) Briefly explain Strassen’s matrix multiplication. Obtain its (12 Marks) complexity. Apply the algorithm to multiply the given 2 matrices.
1 2 5 6 3 4 X 7 8
b) Differentiate between DFS and BFS tree traversals. Explain how
DFS algorithm can be used to obtain the topological sorting with an example. (08 Marks)
PART -B
5. a) Write and explain the Heap sort algorithm using top-down approach.
Sort the elements {M,O,R,N,I,N,G} in alphabetical order. (10 Marks)
b) Explain the Boyer-Moore algorithm for string matching with an example. (10 Marks)
6 a) Construct the open hash table and closed hash table for the input: 30,20,56,75,31,19 using the hash function h(k)=k