Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!VAX1.ACS.UDEL.EDU!heilpern From: heilpern@VAX1.ACS.UDEL.EDU (HEILPERN) Newsgroups: comp.lang.modula2 Subject: Re: Sorts Message-ID: <8909111740.AA27978@vax1.acs.udel.edu> Date: 11 Sep 89 17:40:41 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Modula2 List Organization: University of Delaware Lines: 14 As I am only in a first level modula course, I can't yet describe the specifics, but here is the simple method of performing a bubble sort, not the best sort in the world, but effective, especially as a learning tool... for (I = 0; I < NUMITEMS-1; I++) for (J = I+1; J < NUMITEMS; J++) if (item[J] 'goesbefore' item[I] 'swapthem') This is written similar to the C construct. I++ means 'I:=I+1', or INC(I). Let me know if this is too vauge... Mark A. Heilpern --M. respond to heilpern@brl rather than as the mailer says!!!