Assignment 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Div: SEA ASSIGNMENT 1 Dt.03.03.

22

1. What do you mean by asymptotic notations. Describe every notation with examples.
2. With an example explain the time complexity of iterative and recursive procedures.
3. A()
{ i=1,s=1;
while( s<=n)
{
I++;
s=s+i;
printf(“ A”);
}
}---find time complexity.

4. T(n)=n+T(n-1)...find time complexity.


5. T(n)=n+2T(n/2)...find time complexity using tree method and using master theorem.
6. Which function is larger f(n)= 2n and g(n)=nlogn prove.
7. Find time and space complexity.
A()
{
if(n>=1)
{
A(n-1);
printf(n);
A(n-1);
}
}
8. Analyze algorithm of insertion, quick sort, merge sort with example and find time and
space complexity of it. Why are they called inplace/out place sorting algo? Analyze and
Explain best case, worst case behavior with examples for each one of them.
9. Explain job sequencing algorithms with examples. Find its time complexity.
10. Explain fractional knapsack algorithms with examples. Find its time complexity.

You might also like