Unique Elements in a List

Scott David Daniels Scott.Daniels at Acm.Org
Thu May 12 12:38:19 EDT 2005


Edvard Majakari wrote:
> I realized that, but maybe I should've pointed it out too. For the OP if
> he/she is unaware - notation O(N^2) (big O n squared) means the computing time
> of the algorithm increases exponentially (where exponent is 2) relative to the
> size of the input.
Normally this is called a polynomial, rather than exponential increase.
Exponential increases are typically of the form (C^N) (they are all
equivalent).
Polynomial times are hallways characterized by their largest exponent,
So you never call something O(N^3 - N^2) Since, as N gets large enough,
The N^2 term shrinks to non-existence.

     http://en.wikipedia.org/wiki/Exponential_time

 > ... generally one should avoid using exponential O(n^k) (where k > 1)

Again polynomial, not exponential time.  Note that there is no
polynomial time algorithm with (k < 1), since it takes O(n) time
to read the problem.


--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-list mailing list