On Fri, Apr 1, 2016 at 3:10 PM, Chris Kaynor <ckay...@zindagigames.com> wrote:
> The overall algorithm is O(n^2), as its doing a O(n) operation in a O(n)
> loop:

Depends on whether the OP expects to find only one match or
potentially multiple matches in the list. E did say "if one of the
elements matches".

If there are only ever a constant number of matches, then it's O(n) overall.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to