Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:two': 0.07; 'though.': 0.07; 'subject:compare': 0.09; 'this:': 0.10; 'am,': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iirc': 0.16; 'pointers': 0.16; 'subject:similar': 0.16; 'algorithm': 0.16; 'tue,': 0.17; 'header :In-Reply-To:1': 0.21; "wasn't": 0.22; 'indices': 0.23; 'received:209.85.210.174': 0.23; 'received:mail- iy0-f174.google.com': 0.23; 'message-id:@mail.gmail.com': 0.28; 'subject:?': 0.29; 'array': 0.30; 'to:addr:python-list': 0.33; 'actually': 0.33; 'chris': 0.34; 'subject:What': 0.35; 'subject:lists': 0.37; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'subject:: ': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=bl6hgIcQMCi53xsD/mkK6btjYGb9xrSc3hn8eTGSUMU=; b=r13axgxGOldiAHLfE+5VuNoQRa5RxV2h8RgBWKaxxqyA4McI+muz6pTr1Xiup4PPOx YR71849X6yrlCousGdujBMKnv+atq17pXsUnNzBVp5dP2zpXQQdAxIOAPmG41S5GEyY3 uU7f/slMhrF1waMpeC1cI7NDsNSlxqYeX3HJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=RK9FKYvjFiG/wDZtXp+AmwtZFLtTgR3zWVYL/HpQai5EesoNlnx9muUcywux+rSyQg Q/DRga8kfNEbJ1nq76DvgjzPCgbCoJ34GAtzy34cz4ugH/18WsID5DCkE2tU78wzyhqc jNztsidZZvYX1utvglD2TwjBhQJe+FcgBe/BU= MIME-Version: 1.0 In-Reply-To: References: <3ff2f4cc-7c26-4f59-9463-d6f0874174d8@dn9g2000vbb.googlegroups.com> Date: Tue, 14 Jun 2011 04:12:46 +1000 Subject: Re: What is the most efficient way to compare similar contents in two lists? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307988768 news.xs4all.nl 49175 [::ffff:82.94.164.166]:36239 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7542 On Tue, Jun 14, 2011 at 4:11 AM, Chris Angelico wrote: > The algorithm went > something like this: > > * Start with pointers to beginnings of both lists. PS. It wasn't C with pointers and the like; iirc it actually used array indices as the "pointers". Immaterial to the algorithm though. ChrisA