You are on page 1of 1

School of Data Science and Forecasting

Devi Ahilya Vishwavidyalaya, Indore


First Term Test M.Tech.:1st Semester (Batch 2020-22)
Subject: Fundamentals of algorithms

Time: one hour Maximum Marks: 20


Note: Attempt all questions

Q1 Explain asymptotic notations.


Q2 Write the quick sort algorithm and place 56 at its right position in the following:
90, 67, 55, 13, 79, 05, 44, 56, 99, 34, 77, 11
Q3 Explain Binary Search and apply on the following to search 58 and 189 :
45, 58, 60, 66, 71, 78, 80, 85, 90, 92,115,189

Q4 Write the complexity

1) Sum=0 2) T(n)=2T√n+c
for(i=1; i<=n; i=i*2)
{
Sum=sum+1;
}

3) Sum=0 4) T(n)=T(n/2)+1
for(i=1; i<=n; i=i+1)
{
for(j=1; j<=i; j=j+1)
{
sum=sum+1;
}
}

5) int a = 0;
for (i = 0; i < N; i++) {
    for (j = N; j > i; j--) {
        a = a + i + j;
     }
}

You might also like