in Algorithms
530 views
0 votes
0 votes

f(n)=O(g(n))

Which of the following is True?

  1. 2^f(n)=O(2^(g(n))
  2. log(f(n))=O(log(g(n))
  3. f(n)=O(f(n/2))
  4. f(n)=O(f(n)^2)
in Algorithms
530 views

4 Comments

answer is B but can someone help me to how to solve these questions with 100% accuracy because i'm always trying to find counterexample and don't know a formal way to solve
0
0

@Mk Utkarsh could you please share your solution, I am a bit confused between D and B

0
0
let $f(n) =\frac{1}{n}$

$(f(n))^2 = \frac{1}{n^2}$

$f(n) \neq O(\frac{1}{n^2})$

So D is incorrect and i'm not able to find counter example of B
1
1
B is the correct answer bro!
0
0

1 Answer

0 votes
0 votes