248 views
0 votes
0 votes
for n>=0 , if f(n)<g(n) and h(n)<g(n) . How many of the following are false. ?

1. f(n) is O(h(n)).

2.f(n) is not O(g(n)).

3.f(n)+h(n) is O(g(n)).

4.g(n) is not O(f(n)).

5.f(n)*h(n) is O(g(n)).

1 Answer

0 votes
0 votes

the answer should be 3 

1) f(n) is O(h(n)) is false as there is no comparision given  between f(n) and h(n).

2) f(n) is not  O(g(n)) is also false as f(n) < g(n) it is O(g(n)).

3) f(n) + g(n) will be max( f(n), g(n) ) which will in turn be O(g(n)).

4) g(n) is not O(f(n)) is also true as f(n)< g(n).

5) f(n)*h(n) may be O(g(n)) in some cases but not always hence  it is false too.

Answer:

Related questions

1 votes
1 votes
2 answers
1
APOORV PANSE asked Jun 1, 2016
3,017 views
Consider the following c fragment : void DAA(n) { int i,j,k,x=0; for (i=1 ; i <=n ; i++) for (j=1 ; j <= i * i ; j++) { if ( j mod i == 0 ) for ( k = 1 ; k <= j ; k++) x=...
0 votes
0 votes
1 answer
2
kickassakash asked Jul 4, 2023
421 views
I have specific doubt on this question and I’ve tried to explain that in the picture ,If anyone can explain it then it’ll be of great help. according to sachin sir th...