Unique Elements in a List
Andrew Dalke
dalke at dalkescientific.com
Thu May 12 22:40:22 EDT 2005
Scott David Daniels wrote:
> 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.
Being a stickler (I develop software after all :) quantum computers
can do better than that. For example, Grover's algorithm
http://en.wikipedia.org/wiki/Grover%27s_algorithm
for searching an unsorted list solves the problem in O(N**0.5) time.
Being even more picky, I think the largest N that's been tested
so far is on the order of 5.
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list