comp.lang.ada
 help / color / mirror / Atom feed
From: slinky.cs.nyu.edu!slinky.cs.nyu.edu!nobody@nyu.edu  (Robert Dewar)
Subject: Re: Hoare's gripes about Ada (should be so what)
Date: 2 Sep 93 02:38:31 GMT	[thread overview]
Message-ID: <263mb7$mpd@schonberg.cs.nyu.edu> (raw)

Boy this is getting off the topic, but it's hard to stand by quietly and
see blatantly incorrect technical comments.

"Sorting has been proved to take O(n log n) time"

is plain wrong. This bound applies only if the sorting is restricted to
comparisons. If arithmetic operations are required, this bound obviously
does not apply. Consider a trivial case of sorting a huge pile of numbers
in the range 1 .. 100.

This has an obvious O(N) implementation (just keep an array of 100 entries
which count the number of occurrences of each possible entry). By using
linked lists, other associated data can be carried along, still in O(N)
time.

Address distribution sorting has an expected average performance much
better than O (N long N), in fact it approaches linear performance
asymptotically in the average case if your distribution function is
well behaved. A lot of large scale sorting (the kind done on giant mainframes
with zillions of records) uses address calculation sorting.

Finally, note that in this day of parallel machines, even if you are
restricted to comparisons, you can do much better than O (N log n).

             reply	other threads:[~1993-09-02  2:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-02  2:38 Robert Dewar [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-01 22:32 Peter Juhl
1993-09-01 17:02 Mark A Biggar
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