I'm struggling to show that : $n^{n-2} = O(2^{n^2})$ .
I know the definition of big O but I don't know any method to show this. Could you please help me giving a few methods?
I'm struggling to show that : $n^{n-2} = O(2^{n^2})$ .
I know the definition of big O but I don't know any method to show this. Could you please help me giving a few methods?
Here is a less obvious approach for the cases when it will not be as simple as in Shubham's answer. Note that $f(x) < g(x) \iff \ln f(x) < \ln g(x)$ and compare the logs to get $$ \ln\left(n^{n-2}\right) = (n-2) \ln n = \Theta(n \ln n) $$ versus $$ \ln \left(2^{n^2}\right) = n^2 \ln 2 = \Theta\left(n^2\right)... $$