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.064 X-Spam-Evidence: '*H*': 0.87; '*S*': 0.00; 'sure.': 0.05; 'to:name:python mailing list': 0.09; 'algorithm': 0.13; '...,': 0.16; 'then:': 0.16; 'thanks,': 0.19; 'elements': 0.24; 'guess': 0.26; "i'm": 0.28; 'message-id:@mail.gmail.com': 0.29; 'array': 0.30; 'sort': 0.33; 'hi,': 0.34; 'someone': 0.34; 'to:addr:python- list': 0.35; 'received:209.85.160': 0.36; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'could': 0.38; 'received:209.85.160.46': 0.39; 'received:mail- pw0-f46.google.com': 0.39; 'received:209': 0.39; 'called': 0.40; 'to:addr:python.org': 0.40; 'selection': 0.40; 'simple': 0.61; 'subject:name': 0.67; 'anywhere.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=4hzdZHesQGO2kqS7ooQpxnXkirdHnfWh+CI7RUrLDgM=; b=DnUrGpotO1D5ZwVlAuJVaj8PsRoJkCHYPaCbPqM0yKW8qF1evDhKFF2aEtnGWiFAf7 CJ/8MwqgKsHIIAElg2aCrcU9GpbSST7FzzvRM/evTXSKcReJgl9R1fJuDrmTQn8Yt+uI PAFQPyzs+ETN7qWNQevAZiqaDew1B1vNrwk40= MIME-Version: 1.0 From: Jabba Laci Date: Tue, 14 Feb 2012 16:01:05 +0100 Subject: name of a sorting algorithm To: Python mailing list 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1329231688 news.xs4all.nl 6863 [2001:888:2000:d::a6]:33058 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20399 Hi, Could someone please tell me what the following sorting algorithm is called? Let an array contain the elements a_1, a_2, ..., a_N. Then: for i = 1 to N-1: for j = i+1 to N: if a_j < a_i then swap(a_j, a_i) It's so simple that it's not mentioned anywhere. I guess it's called "selection sort" but I'm not sure. The minimum selection sort is an improvement of this one. Thanks, Laszlo