1. (True or False) If f(n) = O(sqrt(n)) then f(n) = O(n), need explain
2. (True or False) sqrt(n) = O(lg n), need explain
1. True: yes this is true for the above
expression.
Because O(n) is the upper bound for the sqrt(n) thus any expression
which is greater than sqrt(n) would be applicable for this.
And sqrt(n) < n
Thus f(n) = O(n) is also correct.
2. False
For this, we need to see the graph for log(n) and sqrt(n).
As from the graph, it is clear that sqrt(n) > log(n) Thus log(n) = O(sqrt(n)) not the otherway arround, as sqrt(n) is the upper bound for the log(n).
That was a nice
question to answer
Friend, If you have any doubts in understanding do let me know in
the comment section. I will be happy to help you further.
Please like if you think effort deserves like.
Thanks
Get Answers For Free
Most questions answered within 1 hours.