Recent questions tagged asymptotic-notation

1 votes
0 answers
5
Consider the following three functions defined for all positive integers $n \geq 0$.\[\begin{array}{l}f(n)=|\sin (n)+n|, \\g(n)=n, \\h(n)=|\sin (n)| .\end{array}\]Which o...
0 votes
1 answer
7
$\text{Please explain True or False and Why ?}$$\text{1. f(n) = O(f(n/2))}$$\text{2. f(n) = O($f(n)^{2}$) }$
1 votes
1 answer
9
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } }What will be the time complexity of the above code?
0 votes
1 answer
10
0 votes
5 answers
11
Select the function(s) which is/are $O(n log n)$:$2n\log n+3n$$10n\log n^2$$1+\sqrt n$$2n^2-3n$
9 votes
4 answers
19
Let $f$ and $g$ be functions of natural numbers given by $f(n)=n$ and $g(n)=n^{2}.$ Which of the following statements is/are $\text{TRUE}?$$f \in O(g)$$f \in \Omega(g)$$f...
21 votes
4 answers
20
Consider functions $\textsf{Function_1}$ and $\textsf{Function_2}$ expressed in pseudocode as follows:Function_1 | Function_2 while n 1 do | for i = 1 to 100 * n do for ...