Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!tpmg0848 From: tpmg0848@uxa.cso.uiuc.edu (Tom Magliery) Newsgroups: comp.edu Subject: Re: ALGORITHMS ANYBODY? Keywords: but i digress Message-ID: <1990Aug24.183639.15361@ux1.cso.uiuc.edu> Date: 24 Aug 90 18:36:39 GMT References: <90Aug22.090345edt.9450@neat.cs.toronto.edu> <1990Aug23.153652.23949@Neon.Stanford.EDU> <12872@june.cs.washington.edu> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 32 Since this has evolved into a discussion of sorting-for-beginners, I'll add a couple of my cents on an idea that nobody's mentioned yet... I find it useful to teach insertion and selection sort together, rather than to emphasize one or the other. The similarity between them makes a nice generality that helps the students to remember what's going on. In particular, with both methods, the idea is that you select an item from an unsorted pile, and insert it into a sorted pile; the difference is where you "get smart". With insertion sort, you pick up any element you want, and then you "get smart" about where you put it down. With selection sort you "get smart" about which element you pick up, and then you don't have to think much about where you put it down. I thought of this all by myself as a way to keep the two straight. Of the 5 or 6 professors with whom I've been involved who've taught these methods, only one drew the analogy. I think it helped the students. As for teaching bubble sort, I do think it's nifty-looking if you can do a neat demonstration, preferably with a program running so the students can see why it's so named. To me, it's no more intuitive than insertion or selection, though, and those can be neato-ly demonstrated, too. But (I don't think anybody has mentioned this either) bubble takes *less code*. This may not seem very important to us (I'm not sure how important I consider it), but it is often important to the students, so it's something to keep in mind. Enough. mag -- ____._._...___.....__.__.._..__ Tom Magliery mag@cs.uiuc.edu OR mag@uiuc.edu