Article View: k12.ed.science
Article #930Re: Advanced Placement Exams for C++
From: Ian S. Nelson
Date: Sat, 14 Oct 1995 00:00
Date: Sat, 14 Oct 1995 00:00
51 lines
3618 bytes
3618 bytes
shapirj@rintintin.Colorado.EDU (Jim Shapiro) writes: >In article <45mjvk$pil@CUBoulder.Colorado.EDU>, >Robert Tarrall <tarrall@plutus.Colorado.EDU> wrote: >>Jim Shapiro (shapirj@rintintin.Colorado.EDU) wrote: >>: Ian S. Nelson <nelsoni@rintintin.Colorado.EDU> wrote: >>: >There are tons of applications where bubble sort is one of the best algorithms. >>: >Various sort algorithms can be speed up a lot by not completely sorting >>: > [ rambling deleted ] >>: >Sorry to ramble, but I can't stand by and let somebody knock (even in jest) >>: >everybody's favorite sorter... It's an amazingly useful algorithm. >>: >>: From 'Numerical Recipes - The Art of Scientific Computing' by Press et al >>: Page 227: >>: >>: "We _will_ draw the line, however, at the inefficient N squared algorithm >>: _bubble sort_. If you know what bubble sort is, wipe it from your mind; >>: if you don't know, make a point of never finding out!" (Emphasis not mine.) >>: Jim Shapiro - number theorist and Perl pragmatist >> >>And if it's in NumRec, it's gotta be right, eh? >I think I would say yes to that question. I was the original alpha >tester for the FORTRAN version of "Recipes" and it was amazingly solid >for an alpha. In 200+ functions I located exactly two bugs. That is not >to say that I agree with them everywhere, but it is a _very_ good >reference. Can you tell me any place (besides this one) where you have >found them to be wrong? So they say to forget about bubble sort and they are "correct?" That is a very subjective thing to say, can they prove their correctness? I studied CS at Carnegie Mellon University with Merrick Furst, Danny Sleator, Jim Morris, Avrim Blum, Guy Steele and numerous other well respected scientists and some of them agree that bubble sort is near useless, some see it as a great tool in some places. Who's to say? >I do not what languages you use, but I no longer code _any_ sorting >algorithms any more than I code sine and cosine. I have done both, but at >least in C (qsort) and Perl (sort) sort is built in and at the system >level the sort routine is extremely fast, flexible and solid. It's not a stable sorting algorithm (the C stdlib qsort.) What do you do if you need a stable sorter? Or what does Num Rec. suggest for stable sorting? I don't really code sorters anymore either, I wrote a nice C++ templated sorting object with all of my favorite algorithms (actually, all the algorithms I knew of) and I just use it and decide which algorithm to use for whatever task I'm doing. I do have to code in other languages fairly often and I just cut and paste and do a quick port most of the time.. Only SML has given me any grief...
Technical Details
Message-ID:
<nelsoni.813658562@rintintin.Colorado.EDU>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<45e8r1$9sr@shiva.usa.net> <nelsoni.813597537@rintintin.Colorado.EDU> <45m8mp$7m2@CUBoulder.Colorado.EDU> <45mjvk$pil@CUBoulder.Colorado.EDU> <45mmku$orb@CUBoulder.Colorado.EDU>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,a952128d31e3135f X-Google-Attributes: gid109fba,public X-Google-Thread: 11013a,a952128d31e3135f X-Google-Attributes: gid11013a,public X-Google-Thread: f49ec,a952128d31e3135f X-Google-Attributes: gidf49ec,public X-Google-Thread: f86a3,a952128d31e3135f X-Google-Attributes: gidf86a3,public From: nelsoni@rintintin.Colorado.EDU (Ian S. Nelson) Subject: Re: Advanced Placement Exams for C++ Date: 1995/10/14 Message-ID: <nelsoni.813658562@rintintin.Colorado.EDU> X-Deja-AN: 117560322 references: <45e8r1$9sr@shiva.usa.net> <nelsoni.813597537@rintintin.Colorado.EDU> <45m8mp$7m2@CUBoulder.Colorado.EDU> <45mjvk$pil@CUBoulder.Colorado.EDU> <45mmku$orb@CUBoulder.Colorado.EDU> organization: University of Colorado at Boulder newsgroups: k12.ed.science,k12.ed.math,boulder.general,comp.lang.c++