I'm newbie in algorithm time complexity.
I had a function, f(n) = 2n2 - 4n
.
I have to proof that f(n) = O(n2)
.
We can take it like this:
f(n) = 2n2 - 4n
$\le$ 2n2 + n2 $\le$ 3n2
What if I just omit the -4n
? Because, 0 is the upper bound of -4n
? So, it becomes like:
f(n) = 2n2 - 4n
$\le$ 2n2 + 0 $\le$ 2n2