Professional Documents
Culture Documents
Question No 3: Why we use asymptotic notation? List the following function according to
their order of growth from the lowest to highest. (2)
6(n^2)/6n, (6nn – 7/3), 100n log2 n, (n3+50), (3/2 + 4 – 8/2), (2n2+3), 25n
Question No 4: suppose we have two algorithms (A and B) for a single problem where A’s
time complexity is n! and B’s is 1. Assume two different data set of n sizes ,consider( n=10
and n=50) for each algorithm. Which one will be preferable and why ,justify your answer?
(2)
Question No 6: analyze the following find algorithm, identify primitive operations on each
step also calculate its complexity function . (2+2)
UniqueElements(A[0..n-1])
if(A[i] = A[j])
return false
sum = 0;
Max_sum= A[N-1];
Max_sum = sum;