Path: utzoo!attcan!uunet!willett!ForthNet From: ForthNet@willett.UUCP (ForthNet articles from GEnie) Newsgroups: comp.lang.forth Subject: All Sorts of Sorts Message-ID: <445.UUL1.3#5129@willett.UUCP> Date: 11 Feb 90 19:26:44 GMT Organization: Latest link in the ForthNet chain. (Pgh, PA) Lines: 25 Date: 02-10-90 (08:33) Number: 2880 (Echo) To: ZAFAR ESSAK Refer#: 2877 From: IAN GREEN Read: NO Subj: LEARN TO SORT Status: PUBLIC MESSAGE Even though I am not much of a Forther, I am still willing to help Forth programmer's make the best of what they are doing. The added exit in the program will indeed improve the performance dramatically, especially in partially ordered data. If you saw my earlier discourse on sorts in the Modula-2 conference, you may have noticed how the use of a guard could improve the bubble sort even more. The reason is simple, if the zero-eth element of the array is set to the minimum value of the data type in question, then one of the two compares can be effectively eliminated by virtue of the fact that the bubbling process is now guaranteed to terminate at the top of the array. Later I plan to post so additional sorts in the Modula-2 conference so keep your eyes open. Ian Green NET/Mail : British Columbia Forth Board - Burnaby BC - (604)434-5886 ----- This message came from GEnie via willett through a semi-automated process. Report problems to: 'uunet!willett!dwp' or 'willett!dwp@gateway.sei.cmu.edu'