Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Sort char array
Date: Wed, 09 Oct 2019 02:14:53 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <86pnj68elu.fsf@linuxsc.com>
References: <5d98ba3c$0$3549$426a34cc@news.free.fr> <41c5af06-ddef-42d4-bb9a-727a472fe3c4@googlegroups.com> <87a7aclcs1.fsf@bsb.me.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="c0077320ebba5bb8d2e49a5d4c287ef2"; logging-data="842"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+n5l5x3v+6Nw7VMo8gruF8ZjccU5H1yfI="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:FNIKxYY/g4Mc8EBlEpO89XxoO8o= sha1:zvmEZ94WdMeM7vH+a8yP17f0XEw=
Xref: csiph.com comp.lang.c:146791
already5chosen@yahoo.com writes:
> [...] straight insertion sort is both easier to understand and
> easier to code than bubble sort. [...]
>
> "Easier to understand" is, in my view, rather important advantage
> of both insertion sort (insert item n into sorted sub-array of
> length n-1) and selection sort (find first, put it first, find 2nd
> put it second, etc...) over bubblesort.
To me bubble sort is easier to understand than either insertion
sort or selection sort, and that is its primary virtue. I agree
that in most ways the other two are better, but I don't think
being easier to understand is one of them. Also I acknowledge
that what is easy to understand is highly subjective, and other
people may reasonably hold different views on the matter.