New Ada Assign Mment
New Ada Assign Mment
2.Explain asymptotic notations Big Oh, Big Omega and Big Theta notations.
3.Write an algorithm to find the maximum element in an array of n elements. Give the
mathematical analysis of this non recursive algorithm
4.Explain the general plan for analyzing the efficiency of a recursive algorithm. Write the
algorithm to find a factorial of a given number. Derive its efficiency.
5.If t1(n) ∈ O(g1(n)) and t2(n) ∈ O(g2(n)), then show that t1(n) + t2(n) ∈ O(max{g1(n),
g2(n)}).(4)
6.With the algorithm derive the worst case efficiency for Bubble sort(4)
7. Consider the following algorithm.
ALGORITHM Enigma(A[0..n−1,0..n−1])
//Input: A matrix A[0..n − 1, 0..n − 1]of real numbers
for i ←0 to n−2do
for j ←i +1 to n−1do
if A[i, j]= A[j,i]
return false
return true
i)what does this algorithm compute?
ii)what is its input size?
iii)what is its basic operation
iv)how many times the basic operation operates?
v)what is the efficiency class of this algorithm
10.Design merge sort algorithm. Write a descriptive note on its its best case, average case, and
worst-case time efficiency
11.Apply quick sort algorithm to sort the list E, X, A, M, P, L, E in alphabetical order. Draw the
tree of recursive calls made.
12. List out the advantages and disadvantages of divide and conquer approach(4)
13.Give the recursive algorithm to find the maximum and minimum element from the list and
apply the algorithm to find the maximum and minimum to the list [31,22,12,-7,75,-6,17,47,60]
14. Design an insertion sort algorithm and obtain its time complexity. Apply insertion sort on
these elements. 25,75,40,10,20,
15 Explain Strassen’s matrix multiplication and derive its time complexity.
16 Define topological sorting. Illustrate the topological sorting using DFS method for the
following graph.