retagged by
512 views
0 votes
0 votes
Suppose f, g, h, k : N → N. If f = O(h) and g = O(k), then

1) f + g = O(h + k)

2) fg = O(hk)

3) Both 1 and 2

4) None of the above
retagged by

1 Answer

0 votes
0 votes
Given that:

$f = O(h)$ and $g =O(k)$

This implies that $f  \leq c_1h$ and $g \leq c_2k$.

Let $c_3= max(c_1, c_2)$.

$f + g = c_1h + c_2k \rightarrow f + g = c_3(h + k) \rightarrow f + g \in O(h+k)$.

This is true since we can replace $c_1$ and $c_2$ by $c_3$ while still maintaining the upper bound.

The same logic can apply for $fg$ also.
Answer:

Related questions

0 votes
0 votes
2 answers
2
Balaji Jegan asked Oct 23, 2018
547 views
A man alternately tosses a coin and throws a dice, beginning with the coin. Then probability that he will get a head before he gets a 5 or 6 on dice is1) 1/42) 3/43) 4/54...
0 votes
0 votes
1 answer
3
Balaji Jegan asked Oct 23, 2018
297 views
If mean = (3 median – mode)x, then value of x is1) 12) 23) 1/24) 3/2
0 votes
0 votes
0 answers
4
Balaji Jegan asked Oct 23, 2018
1,001 views
Minimum Hamming distance method is used for correction of1) syntactic errors2) semantic errors3) algorithmic errors4) transcription errors