Assume $u(n)$ calculates $n^2$ in $n$ steps, thus is in $O(n)$, and $v(n)$ calculates the square root of $n$ in $\sqrt n$ steps, thus is in $O(\sqrt n)$.What is the runtime of the program u(v(n))?The argumentation in my solution is:We calculate the square root first, then we take it's square. $\sqrt n + \sqrt n = 2\sqrt n \rightarrow O(\sqrt n).$I don't understand that. Wouldn't it be actually $n + \sqrt n$?
Runtime of a programm that takes the square of a root
runtime analysis