Professional Documents
Culture Documents
Department of Computer Technology Anna University:: Chennai, Mit Campus Chrompet, Chennai - 44
Department of Computer Technology Anna University:: Chennai, Mit Campus Chrompet, Chennai - 44
n!= O(nn)
b)
n3 +10 6n2=(n3)
c)
log3n =O(n1/3)
d)
2n22n+nlogn= (n22n)
e)
3logn+loglogn =(logn)
f)
10n2 + 9 =O(n)
3) Cipher is a method of hiding messages by encoding them. One very simple CIPHER is by
one to one substitution of letters, for example
Original
: AB C D E F G H I J
K L M NO P Q R S T
UVWXYZ
Cipher Code
Thus the word CAT will be send as HFY. Design an efficient algorithm which implements the
above logic.
4) A robot can take steps of 1 meters, 2 meters, or 3 meters. Design the pseudocode for a
recursive algorithm to calculate the number of ways the robot can walk n meters. Give a proof
using induction that your algorithm is correct.
5) Let T(n) = 45n4-5n2+4n-456. Show T(n)= O(T1(n))=(T1(n))=(T1(n))
where T1(n)=n4. Obtain G1(n) and G2(n) where T(n)=o(G1(n))=(G2(n)).
6)Solve the following recurrence equations ,defining T(n) as,
a)
T(n)=
4
T(n-1)+4
if n=1
otherwise
T(n)= 2T(n1/2)+log n
7)Solve the recurrence equation by substitution method , specify the upper,lower and tight
bounds
a)
T(n)=
c
2T(n/2)+bnlogn
if n<2
otherwise
b)
T(n)=
c
16T(n/4)+n2
if n<=2
otherwise
c)
T(n)=
c
T(9n/10)+n
if n<=2
otherwise
8)Consider the following recursive equation T(n)=3T(n/2)+n .Determine the upper bound using
recursion tree .Verify your answer with substitution and master method.
9)Solve the following recurrence equation using Masters method ,specify the upper,lower and
tight bounds
a) T(n)=
b) T(n)=
c
4T(n/2)+n2n
c
7T(n/3) + n2
10) Try to explain what is Little Oh and Little Omega. Can you relate and compare it with Big
Oh and Big Omega. (Optional Question)
11) Write an algorithm using recursion to compute GCD of two non negative numbers without
using division operation. Determine its time complexity and appropriate bounds.
12) Give a brief study on algorithm efficiency and asymptotic notations.
With Reference to ,
1) Fundamentals of Computer Algorithms ,Horowitz,Sahni,Sanguthevar
2) Computer Algorithms,Introduction to Design & Analysis,Sara Baase,Allen
3) Algorithm Design,Foundations,Analysis and Internet Examples, Michael.T.Goodrich,
Roberto
4)Introduction to Algorithms, T.H.Cormen