Tight bound on the worst running time

101 Views Asked by At

I have to find a tight bound for an algorithm.

I ended up with $3n^2 + 5$ as the worst running time of the piece of code.

Is it ok if I consider $n^2$ as the tight bound? $$3n^2 + 5 \in \Theta(n^2)$$

My justification is the following: $$3n^2 \le 3n^2 + 5 \le 8n^2$$

1

There are 1 best solutions below

0
On BEST ANSWER

I would agree that reasoning. Intuitively I would ignore any addition or multiplication of scalars from the bound.