Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: Most pythonic way of rotating a circular list to a canonical point Date: Sat, 01 Aug 2015 14:43:14 -0700 Organization: A noiseless patient Spider Lines: 12 Message-ID: <873802lm6l.fsf@jester.gateway.sonic.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="d4217d68945dedf510265c644f2a7daa"; logging-data="23223"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/LgKV4GsmkxlI9v7ocBNJn" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:J4vPkWXhip0Lqy8sn1OAukxRmQc= sha1:Je6wbPdh1tvrXDfvaNY6xqmzAhQ= Xref: csiph.com comp.lang.python:94869 Lukas Barth writes: > - It does not matter what that rotation is. Starting with the smallest > element was just an idea by me, any rotation that can easily produced > will do. How large are these lists supposed to be? If they're (say) 5 elements, you could make the hash code consist of the concatenated hashes of each of the 5 rotations, or maybe a Bloom filter on those hashes. Then to do a lookup, hash your target list and see if it appears in the table. If the lists are very large that doesn't sound so great due to storage requirements..