Anda di halaman 1dari 1

DESIGN AND ANALYSIS OF ALGORITHMS

I UNIT

1. a) Define an Algorithm . Describe the Characteristics of the algorithm.


b) what do you meant by input size of a problem? Explain its Significance.
c) Differentiate between profiling and debugging.

2. Develop a probabilistic algorithm to find the value of the integral  √4    dx.

3.What do you mean by performance analysis of algorithm? Explain.


4.Define time and space complexity with a mathematical formula. By taking an example calculate the
time and space requirements of an algorithm.
5. a)Define time complexity. Describe different notations used to represent these complexities.
b) Discuss the issues related to time complexity.
6.write the non-recursive algorithm for finding the Fibonacci sequence and derive its time complexity.
7.A complex valued matrix X is represented by a pair of matrices (A,B) where A and B contain real values.
Write an algorithm that computes the product of two complex valued matrices (A,B) and (C,D) where
(A,B) * (C,D)=(A+iB)*(C+iD)=(AC-BD)+i(AD+BC).
Determine the number of additions and multiplications if all the matrices are all n X n.
8.Write an algorithm to find largest of given ‘n’ numbers. Derive its time complexity using big ‘Oh’
notation.
9.a )Order the following functions according to their order of growth(from lowest to the highest). (n-2)!,
5log(n+100)10,22n 0.001 n4+ 3n3 +1,ln2 n, n1/3 3n
b)Show that f(n)+g(n)=O(n2) where f(n)=3n2 –n+4 and g(n)=nlogn+5.
c) Derive the Function f(n)=12n2 +6n is O(n3) and Ω(n).
10) a) Show That f1(n) X f2(n)=O(g1(n) X g2(n)) where f1(n)= O(g1(n)) and f2(n)=O(g2(n))
b) Show That f1(n) + f2(n)=O(max(g1(n)Xg2(n))) where f1(n)= O(g1(n)) and f2(n)=O(g2(n))
c)Prove That f(n)=O(h(n)) where f(n)=O(g(n)) and g(n)=O(h(n)).
d) Show That f(n)=8n+128=O(n2).
11) Consider a polynomial in n of the form.
f (n)=∑



= amn
m
+ am-1nm-1 +……….+ a2n2 + a1n+ a0 where am >0 then f(n)= Ω(nm).
12. a) Show that f(n)=4n2 – 64 n + 288 = Ω(n2).
b) Show that n3logn is Ω(n3).
13.Write About amortized analysis and probabilistic analysis, differentiate between average-case analysis,
probabilistic analysis and amortized analysis.
14.Give a Monte-carlo algorithm for finding the majority element in an array.
b)Explain Las Vegas algorithm for finding the repeated element in an array.
15.a) What are the advantages and disadvantages of randomized algorithms?
b) Write about cost amortization.

Anda mungkin juga menyukai