Professional Documents
Culture Documents
com 06CS43
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)
3 2
i) n(n+1)/2 € O(n ) ii)n(n+1)/2 € O(n )
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
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 mod 11. (08 Marks)
b) State all-pairs shortest path algorithm. Solve the given (12 Marks)
problem using that-
0 2 ∞ 1 ∞
6 0 3 2 ∞
∞ ∞ 0 4 ∞
∞ ∞ 2 0 3
3 ∞ ∞ ∞ 0