Assignment 1
Q1- What is an Algorithm? How to write an Algorithm explain?
Q-2 Write an algorithm to find maximum element from an array?
Q-3 What are Designing techniques of an algorithm? Explain all it’s Types with an
example?
Q-4 Find the recurrence relation of following recursive function?
int count(n){
if (n==1){
return 1;
}
return 1+count(n-1);
}
Q-5 What are loop invariants ?Explain with code?
Q-6 What are control statements? Explain?
Q-7 T(n)=4T(n/2)+n→find the time complexity using Tree recursive method?
Q-8 T(n)=2T(n/2)+1➔ find the time complexity using substitution method?
Q-9 T(n)=8T(n/2)+n-> find the time complexity using Master method. Tell which
case is applied using big-oh ,omega or theta functionalities?
Q-10 Find the recurrence relation of recursive selection sort ?Find it’s time
complexity?
Q-11 What is divide and conquer technique? What are steps of this technique?
Explain with code?
Q-11 Define Binary search? Write code for recursive binary search? Find
recurrence relation and time complexity for the same?
Q-12 What is merge Sort? Explain with an array? Write an algorithm for merge
sort?
Q-13 What is MinMax Algorithm ? Explain with an array={2,4,1,8,3}.
==========================END====================================