Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!uwm.edu!uakari.primate.wisc.edu!samsung!uunet!microsoft!alonzo From: alonzo@microsoft.UUCP (Alonzo Gariepy) Newsgroups: comp.sys.handhelds Subject: Re: A few 'might be useful' programs Message-ID: <8809@microsoft.UUCP> Date: 11 Nov 89 01:37:39 GMT References: <266@sigma2.sm.luth.se> Reply-To: alonzo@microsoft.UUCP (Alonzo Gariepy) Organization: Microsoft Corp., Redmond WA Lines: 22 In article <266@sigma2.sm.luth.se> writes: > REV[B929] ; Reverses a list. Try VARS REV. You sould now have > << DUP SIZE -> list n ; the variable list in reversed order. > << > IF n > THEN |ost 2 n > SUB REV list 1 GET + > ELSE { } > END > >> > >> Here is a simpler, faster list reverser. REV << LIST-> 1 SWAP FOR j j ROLL NEXT LAST ->LIST >> Non-recursive solutions are more intuitive for all these linear alorithms. I like the quicksort which, of course, lends itself to recursion. Alonzo Gariepy alonzo@microsoft