That interesting notation used to describe how long a loop will take.

Niklasro niklasro at gmail.com
Tue Oct 5 04:55:23 EDT 2010


On 4 Okt, 20:38, Tobiah <t... at rcsreg.com> wrote:
> It gets used here frequently, but not
> having majored in programming, I'm not
> familiar with it.  One might say:
>
> Don't do it that way, it will result in O(n**2)!
>
> Or something like that.  I read this to mean
> that the execution time varies with the square
> of the number of iterations, or items being sorted
> etc..
>
> I want to google this, but I'm not sure what
> keywords to use.  Is there a wikipedia article about this
> subject?  I imagine that it has a concise name.
>
> Thanks,
>
> Tobiah

Big O relates input size to computation time. For example mission is
"make the program 1000 times faster"
you can
a) buy much more expensive hardware
b) rewrite exponential time algorithms to polynomial time and
likewise.
And look at a sheet with 10 best algorithms, they have times noted and
where applicable for example sorting a set that's already somewhat
sorted another method than sorting a very unsorted set is applicable.
Regards,
Niklas



More information about the Python-list mailing list