Consider the following algorithms. Assume, procedure $A$ and procedure $B$ take $O(1)$ and $O(1/n)$ unit of time respectively. Derive the time complexity of the algorithm in $O$ -notation.
algorithm what (n)
if n = 1 then call A
Let's suppose $n=5$. So for that time complexity will be:
= approximately equal to $c$
So complexity should be $O(1)$.
But answer is $O(n)$.What I am doing wrong?