comp.lang.ada
 help / color / mirror / Atom feed
From: dst17!mab@ford-wdl1.arpa  (Mark A Biggar)
Subject: Re: Hoare's gripes about Ada (should be so what)
Date: 1 Sep 93 17:02:45 GMT	[thread overview]
Message-ID: <1993Sep1.170245.17746@wdl.loral.com> (raw)

In article <CCoI96.DqH@jabba.ess.harris.com> smccoy@dr3w.ess.harris.com (Scott 
McCoy) writes:
>In article <1993Sep1.030349.9524@seas.gwu.edu>, mfeldman@seas.gwu.edu
>(Michael Feldman) writes:
>|> I'll take a copy. An Ada version could turn up in an insanely great
>|> data structures book. You'll get full credit, of course.
>Heck, if you're taking contributions, why not include the SlowSort?
>It has to be just about the *worst* sorting algorithm ever devised!
>I use it as a orientation exercise in my Ada training courses.  Kinda
>fun to watch a 14 element sort take 10 minutes to finish!  :-)

I don't know what the algorithm for Slowsort is but the two worst sorting 
algorithms I know of are permutation-sort and 52-pickup-sort.

Permutation-sort sometimes shows up in prolog programs by a naive 
translation of the declaritive definition of sorting directly into prolog:

sort(List) :- permute(List),ordered(List).

I.E. using a backtracking algorithm to produce succesive permutations of the
original list and then checking if the new permutation is ordered.

Even worse is 52-pickup sort, which is also easy to express in prolog:

sort(List) :- random-shuffle(list),order(list).

I.E. this is like sorting a deck of cards by throwing it up in the air,
picking up all the cards (without looking at them) and then checking if
they just happen to be sorted, if not repeat.  You can't even express an 
big O bound for this alogorithm, only an expected number of iterations.

--
Mark Biggar
mab@wdl.loral.com

             reply	other threads:[~1993-09-01 17:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-01 17:02 Mark A Biggar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-13 13:32 Hoare's gripes about Ada (should be so what) Wes Groleau x1240 C73-8
1993-09-10 18:08 Dag Bruck
1993-09-10  0:49 Michael Feldman
1993-09-09 21:07 Robert Dewar
1993-09-09 18:53 Dag Bruck
1993-09-03 19:44 Wes Groleau x1240 C73-8
1993-09-02  3:10 Michael Feldman
1993-09-02  2:40 Robert Dewar
1993-09-02  2:38 Robert Dewar
1993-09-01 22:32 Peter Juhl
1993-09-01 14:15 agate!howland.reston.ans.net!darwin.sura.net!jabba.ess.harris.com!dr3w!sm
1993-09-01 13:14 Ste ve Masticola
1993-09-01  3:03 Michael Feldman
1993-08-26  3:04 Colin James 0621
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox