in Algorithms
394 views
2 votes
2 votes

Let f (n) = Ο(n), g(n) = Ο(n) and h(n) = θ(n).

Then [f (n) . g(n)] + h(n) is _______.

a.Ω(n)

b.Ο(n)

c.θ(n)

d.None of these

in Algorithms
by
394 views

8 Comments

Is it C?
0
0
if
f(n) = n which is O(n)
g(n) = n which is  O(n)
h(n) = n

$f(n)*g(n) + h(n) = (n^2 + n) = O(n^2).$

if
f(n) = 1 which is O(n)
g(n) = 1 which is  O(n)
h(n) = n

$f(n)*g(n) + h(n) = (c + n) = omega(n).$

Hence (A) is the correct choice!
1
1
yes , answer should be a ie omega(n) but given answer is c
0
0
Manu Sir I understood your solution but can we take f(n)=1 ? I thought f(n) should be a function of 'n' and can't be some constant.
0
0
yes, we can, because we can have a function as $f(n) = n^0$, right? we only need to consider that f(n) is O(n).
(or)

a more practical example, there is a C program which takes n as input and print it, that's all.
0
0
Okay...thank you Sir

And another thing..can we consider f(n)=1/n for such type of  problems  though it is practically impossible for any program?
0
0
yes, we can consider 1/n also and in fact if f(n)=1/n then f(n) is O(1).
0
0
Okay thanks :)
0
0

Please log in or register to answer this question.

Related questions