TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: DAVID NOON
from: GEORGE WHITE
date: 1998-03-30 09:23:00
subject: Insertion Or Bubble?

Hi David,
You wrote to Herman Schonfeld:
DN>DN>I think teachers should teach insertion sort first, as it is simpler to
DN>DN>code
DN>DN>than bubble sort, as well as being faster. [I posted some sample code 
n
DN>DN>this echo a couple of days ago.]
Interestingly Professor Knuth does cover insertion sort (Shellsort)
before exchange sorts (Bubble sort).
DN>HS>Are you sure? Last time I checked bubble sort was slightly faster.
DN>Yes, I am sure, Professor Sedgewick is sure ("Algorithms", Robert 
Sedgewick,
DN>ISBN 0-201-06673-4, page 103) and Professor Knuth is sure (I don't have
DN>Volume III handy, I'm afraid).
Knuth is sure, Vol 3, ISBN 0-201-03803-X page 111, where he also says:
"In short, the bubble sort seems to have nothing to recommend it, except
a catchy name and the fact it leads to some interesting theoretical
problems."
George
 * SLMR 2.1a * Wastebasket: Something to throw things near.
--- Maximus/2 3.01
---------------
* Origin: DoNoR/2,Woking UK (44-1483-717905) (2:440/4)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.