Colin, Let's not argue too much ;). Here how I calculated (It may look simplist and would require experimentation to confirm):
List with 6 elements Yours: 6 loops with 2 operations each = 12 Mine: 3 loops with 3 operations = 9 List with 100 elements Yours: 100 loops with 2 operations each = 200 Mine: 50 loops with 3 operations = 100 I'll try to run tests to confirm and ready to apologize if I'm wrong. Laurent. > -----Original Message----- > From: Colin Holgate [mailto:[EMAIL PROTECTED]] > Sent: 8 f�vrier, 2002 11:05 > To: [EMAIL PROTECTED] > Subject: RE: <lingo-l> turning a list back to front > > > > repeat with i = 1 to nb/2 > > tmp = theList[i] > > theList[i] = theList[nb+1-i] > > theList[nb+1-i] = tmp > > end repeat > >end > > > >This one using just one list: memory economy and is faster > than colin's (for > >a list of 10 elements, Colin's algorithm is doing 20 > operations, mine's > >doing only 15). > > > I'm not so sure about your 20/15 comparison. In mine I was doing an > append of a get, in effect, which for a six element list is 12 > operations. In yours you're doing a get, then a set of another get, > followed by another set. You do that for half the list amount, but it > still totals 12 operations. > > > -- > [To remove yourself from this list, or to change to digest > mode, go to http://www.penworks.com/lingo-l.cgi To post > messages to the list, email [EMAIL PROTECTED] (Problems, > email [EMAIL PROTECTED]). Lingo-L is for learning and > helping with programming Lingo. Thanks!] > [To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
