Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20399

name of a sorting algorithm

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 <jabba.laci@gmail.com>
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 <jabba.laci@gmail.com>
Date Tue, 14 Feb 2012 16:01:05 +0100
Subject name of a sorting algorithm
To Python mailing list <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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5800.1329231688.27778.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

name of a sorting algorithm Jabba Laci <jabba.laci@gmail.com> - 2012-02-14 16:01 +0100
  Re: name of a sorting algorithm Mel Wilson <mwilson@the-wire.com> - 2012-02-14 10:25 -0500
    RE: name of a sorting algorithm "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-02-14 15:50 +0000
      RE: name of a sorting algorithm Mel Wilson <mwilson@the-wire.com> - 2012-02-14 11:44 -0500
        RE: name of a sorting algorithm "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-02-14 20:21 +0000
        RE: name of a sorting algorithm "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-02-14 20:13 +0000
  Re: name of a sorting algorithm Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-02-14 16:33 +0100

csiph-web