Quote Originally Posted by laserlight View Post
That said, if an algorithm's complexity is in O(1) then it is also in O(n), but I presume that we are abusing big-O notation here as it is often abused to mean theta (or something like that, I have not taken my algorithms module in university yet, so I can claim ignorance ).
You don't need to claim ignorance , the following is always true:
Code:
if f(n) = O(1) then f(n) = O(n)
The other direction is not true.
That said, it is customary to give the tighter bound, in this case it's O(1), but it is true that it is ALSO O(n).

Regards,
Zachm