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


Groups > comp.lang.forth > #23951

Re: som probabilistic sorts

Newsgroups comp.lang.forth
Date 2013-06-26 11:59 -0700
References <2013Jun26.181725@mips.complang.tuwien.ac.at>
Message-ID <b232eaf4-f3c7-4bc7-afb2-54eedbbd95a3@googlegroups.com> (permalink)
Subject Re: som probabilistic sorts
From mhx@iae.nl

Show all headers | View raw


anton@mips.complang.tuwien.ac.at (Anton Ertl) writes Re: som probabilistic sorts
> Inspired by the recent flurry of sorting algorithms, I devised some of
> my own, all probabilistic and pretty simple, but still a surprising
> amount of of code.  All code plus some scaffolding at
> <http://www.complang.tuwien.ac.at/forth/programs/badsort.fs>

Bad-sort is simply unbearable (even for 10 elements).
All array elements random, less than 100.
Mediocre-sort speeds up nicely.
Combining maybe-exchange with simple-sort doesn't give a
consistent improvement over simple-sort alone.

FORTH> bm
*** Sorts with /size = 1000 ***
bubble-sort   : 0.005 seconds elapsed.
simple-sort   : 0.003 seconds elapsed.
so-so-sort    : 0.700 seconds elapsed.
mediocre-sort : 0.035 seconds elapsed. ok

FORTH> bm
*** Sorts with /size = 4000 ***
bubble-sort   : 0.054 seconds elapsed.
simple-sort   : 0.020 seconds elapsed.
so-so-sort    : 155.069 seconds elapsed.
mediocre-sort : 0.392 seconds elapsed. ok

-marcel

Back to comp.lang.forth | Previous | NextPrevious in thread | Find similar


Thread

som probabilistic sorts anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-26 16:17 +0000
  Re: som probabilistic sorts mhx@iae.nl - 2013-06-26 11:59 -0700

csiph-web