🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #331

Re: Quicksort vs. Heapsort

#331
From: zebolskyd
Date: Thu, 05 Oct 1989 04:00
19 lines
1352 bytes
Perhaps it would help if I described what I remember seeing in the
QuickBasic demo that did visual sorts.

The algorithm that was (perhaps erroneously) labelled a "Heap Sort" started
out with a nice colorful mess of unsorted elements displayed as vertical
bars of various heights and corresponding colors. One element was then
selected (the criteria for the selection was not apparent, but appeared to
be the leftmost element) and moved to the far left. Then the next unsorted
element was moved to the right of where the first was deposited, and swapped
with it if it was smaller. The next element to be sorted was moved to the
left of the pair, and exchanged with its immediate left neighbor until the
neighbor was smaller. The process continued in this manner, with each unsorted
element being placed at the right edge of what was presumably termed the
"heap" and swapped, one step at a time, until it found its place. Painfully
slow, especially for the latter elements.

How does a _real_ heapsort work?

Lyle D. Gunderson     zebolskyd@yvax.byu.edu
Technical Details
Message-ID: <838zebolskyd@yvax.byu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!psuvax1!psuvm!cunyvm!byuvax!zebolskyd

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!psuvax1!psuvm!cunyvm!byuvax!zebolskyd
From: zebolskyd@yvax.byu.edu
Newsgroups: comp.lang.modula2
Subject: Re: Quicksort vs. Heapsort
Message-ID: <838zebolskyd@yvax.byu.edu>
Date: 5 Oct 89 04:00:18 GMT
Lines: 17