0
$\begingroup$

I'm just starting to learn Big O Notation and I was trying to understand how this function would scale:

$\frac{n(n-3)}{4}$

If the function was $n^2$, it would be quadratic, so O(n^2). However, the denominator gives me pause. Is this still a O(n^2) function? This is not homework. Thanks in advance for the help and clarification.

$\endgroup$
1
$\begingroup$

The denominator is just a constant so $O(\cdot)$ doesn't care about it. For all $n\geq 0$, $\tfrac14n(n-3)\leq 1\cdot n^2$ so $\tfrac14n(n-3)\in O(n^2)$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.