Article View: comp.lang.modula2
Article #245Re: Sorts
From: HEILPERN
Date: Mon, 11 Sep 1989 17:40
Date: Mon, 11 Sep 1989 17:40
14 lines
1083 bytes
1083 bytes
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!!!
Technical Details
Message-ID:
<8909111740.AA27978@vax1.acs.udel.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!VAX1.ACS.UDEL.EDU!heilpernReferences:
<INFO-M2%89091000074411@UCF1VM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <INFO-M2%89091000074411@UCF1VM> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Modula2 List <INFO-M2%UCF1VM.bitnet@jade.berkeley.edu> Organization: University of Delaware Lines: 14