Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!agate!shelby!neon!kanamori From: kanamori@Neon.Stanford.EDU (Atsushi Kanamori) Newsgroups: comp.edu Subject: Re: ALGORITHMS ANYBODY? Message-ID: <1990Aug23.161305.24777@Neon.Stanford.EDU> Date: 23 Aug 90 16:13:05 GMT References: <90Aug22.090345edt.9450@neat.cs.toronto.edu> <4147@iitmax.IIT.EDU> Organization: Computer Science Department, Stanford University Lines: 38 In article <4147@iitmax.IIT.EDU> draughn@iitmax.iit.edu (Mark Draughn) writes: >In article <90Aug22.090345edt.9450@neat.cs.toronto.edu> mgreen@cs.toronto.edu (Marc Green) writes: >[...] >>I've decided to center the course of the view that computer languages >>are a way to formally specify algorithms. I'd like the students to >>program the same 3-4 algorithms in several languages, to get a feel >>for the differences. >[...] >>I have in mind algorithms like bubble-sort, merge-sort, tree-search >>and problems like the Tower of Hanoi. Any others? > > >Seriously, maybe I'm misunderstanding you, but this plan of yours >sounds a bit boring. These algorithms look about the same in almost >all languages. Sure, LISP recursions and FORTRAN loops look >different, but what do you do after that? > I think the intended approach was to disallow side-effects in Lisp; then the difference between Lisp sorters and Fortran sorters are a lot more than just syntactic. In general, the fun part of this approach is choosing problems that require a nontrivial amount of head-scratching to implement in each language. It might help if we try to think in terms of problems rather than algorithms; fixing the algorithm tends to fix the programming paradigm (i.e. some algorithms are naturally Fortran-ish and others are naturally Lisp-ish) and I believe the intent is to force the student to think in the different paradigms of each language. BTW: Don't use Towers of Hanoi; it may be a classical example of recursion but there is an obscure iterative solution: if a student happens to know this, you'll have a horny policy problem on your hands. Tree-search is pretty good as a method of comparing the dynamic-data-structure abilities of different languages. You might also consider a companion problem in which data structures shrink as well as grow (i.e. show how garbage collectors make one's life easier.)