Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.stack.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'completeness': 0.05; 'does.': 0.07; '[0]': 0.09; 'bubble': 0.09; 'result,': 0.15; 'to:name:python-list@python.org': 0.15; '712': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:169.70': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'xrange': 0.16; 'meant': 0.17; 'header:In-Reply-To:1': 0.22; 'elements': 0.24; 'code': 0.26; 'says': 0.27; 'received:169': 0.28; 'received:169.254': 0.28; 'received:155': 0.30; 'received:159': 0.30; 'least': 0.30; 'accuracy': 0.32; 'remaining': 0.32; 'sort': 0.33; 'match': 0.34; 'header:Received:8': 0.34; 'to:addr:python- list': 0.35; 'phone:': 0.35; 'element': 0.37; 'but': 0.37; 'charset:us-ascii': 0.37; 'put': 0.40; 'to:addr:python.org': 0.40; 'selection': 0.40; 'your': 0.61; 'subject': 0.61; 'offers': 0.62; 'subject:name': 0.67; 'information,': 0.69; 'legal': 0.72; 'url:email': 0.72; 'bank': 0.75; 'sale': 0.75; 'investment': 0.77; 'purchase': 0.78; '"put': 0.84; 'received:169.254.8': 0.84; 'sort.': 0.91 X-DKIM: OpenDKIM Filter v2.1.3 sj1.jpmchase.com q1EFoX7W029721 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=jpmorgan.com; s=smtpout; t=1329234634; bh=ptD281O3WwqcI9yqhyr4UrZe5hwL3zE7K5vuqw4wpZg=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=Nq6KzHwnjvjWSvsQJLuIYsQs9F7ed+CKd5jmuSy9lqKX28nzd4MCv3qQ07UTF/LnQ 0lV3/dZDOTMkzSS5sy0ivO7+uvnEbnUp6eKv7ASWOvk3pJ/HUW1NWd13cIRmtx7vJw WAtH0ggWlncKz3vO4AEbpnRdoNPIpeqdV0+dH0u4= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: name of a sorting algorithm Thread-Topic: name of a sorting algorithm Thread-Index: AQHM6yzav4mkGtJ7JUu+b8AREYi1aJY8hsAw Date: Tue, 14 Feb 2012 15:50:14 +0000 References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.38] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329235868 news.xs4all.nl 6946 [2001:888:2000:d::a6]:44775 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20405 > =0D=0Afor i in xrange (N-1):=0D=0A for j in xrange (i, N):=0D=0A = if a[j] < a[i]:=0D=0A a[i], a[j] =3D a[j], a[i]=0D=0A> It's wh= at Wikipedia says a selection sort is: put the least element in [0], the le= ast of the remaining elements in [1], etc=2E=0D=0A=0D=0AIf your only requir= ement to match to selection sort is the end result, then every sort would b= e selection sort=2E If you meant "put the least element in [0] in the first= pass" then that would indeed be selection sort, but that is not what the a= bove code does=2E The above code is bubble sort=2E=0D=0A=0D=0ARamit=0D=0A= =0D=0A=0D=0ARamit Prasad | JPMorgan Chase Investment Bank | Currencies Tech= nology=0D=0A712 Main Street | Houston, TX 77002=0D=0Awork phone: 713 - 216 = - 5423=0D=0A=0D=0A--=0D=0A=0D=0AThis email is confidential and subject to i= mportant disclaimers and=0D=0Aconditions including on offers for the purcha= se or sale of=0D=0Asecurities, accuracy and completeness of information, vi= ruses,=0D=0Aconfidentiality, legal privilege, and legal entity disclaimers,= =0D=0Aavailable at http://www=2Ejpmorgan=2Ecom/pages/disclosures/email=2E