A)
true
yes if the equation is simplified it atmost n run time.
b)
False
Its complexity as to be written in O(2 Log n) as the equation is exponential
C)
False
littile o notation classifies it as o(n2)
d)
TRUE
E)
Flase
Big O notation for the log n factorial must to be
O(n)
As the big o notation says that degree of the polynomial here it repeats at n times
poin (a) 20n-O(n) (c) n=o(log n) (e) log n!= 0(n log nioo) (b) 3(2) 2: 100
(a) Prove that n log^3 n is O(n^2). Prove that n^3 is not O(n^2 log n). (b) The multi Pop (i) method pops i items from the top of a stack. Analyse the amortized complexity of the multiPop (i) method.
O(log(log(N))) < O(log(N)) a. True b. False O(N ) < O(log(N)) a. True b. False O( N5) < O(N2 - 3N + 2) a. True b. False O(2N) < O(N2) a. True b. False
What is the order of the following growth function? t(n)= 5 nlog n + 20n +20 O(log n) Oin log n) o O(n2) 0(1)
Which of the following could be false? A. n2/(log(n)) = O(n2). B. (log n)1000 = O(n1//1000). C. 1/n = O(1/(log(n))). D. 2(log(n))^2 = O(n2). E. None of the above.
Which of the following functions has the highest order of growth? A. 2n+log(n) B. n+2*log(n) C. n+log(2n) D. n+log(n2) E. All of the above have the same order of growth.
2. If x e [0, 1] and n E N, show that xn+1 log(1 + x) – 10g(1 (:- (-) + nxn +(-1)n-1 n n+1 Use this to approximate log 1.5 with an error less than 0.02.
1. Prove that log2(n) is O(n) 2. Prove that log(n!) is O(n log(n))
1. Find the Big Oh notation for the expressions below A. 10,000,000 B. 1+2+3+4+...+n C. 50,000+log(n^2000)+500n D. 5,000(n^2)+7,000,000 E. 700n^3+n^2+50,000,000n+1 F. 2^(n+3)+300(n^3) 2. Identify time complexity in Big O notation for the program segments A. sum=0; for(i=1;i<=n;i=i*3) sum++; B. sum=0; for(int i=1;i<3^n;i=i*3) sum=sum++; for (int j=n;j<0;j--) sum--; C. sum=0; for(i=n;i>=1;i--) for(j=i;j<=n;j++) sum++; D. sum=0; for(i=1;i<=10;i++) for(int j=1; j<=n*n; j++) sum++;
When sorting n records, Merge sort has worst-case running time a. O(n log n) b. O(n) c. O(log n) d. O(n^2)
2. [6 marks] Are the following functions O(n)? Justify your answer. a) n log n b) f(n) = Vn (log n)