Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!jhunix!barrett From: barrett@jhunix.HCF.JHU.EDU (Dan Barrett) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part V (last) Message-ID: <7880@jhunix.HCF.JHU.EDU> Date: 2 Apr 91 04:44:36 GMT References: <781@tnc.UUCP> Organization: The Johns Hopkins University - HCF Lines: 42 In article dillon@overload.Berkeley.CA.US (Matthew Dillon) writes: >There are many, many good algorithms,... Hear, hear!!! Matt is absolutely right -- the algorithm is very often the biggest key to obtaining speed in your program. In my programming courses (I teach CS at Johns Hopkins), my students have been shocked to see the blazing speed improvement you can get by using good algorithms. Here is a simple example: raising a number to a power. I took a typical Power() function and raised a number to the 1,000,000,000 power. It took 30 minutes on a VAX 8530: double Power(double number, long exponent) { long i; double answer = 1.0; for (i=0; iinternet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////