Here it is (no reason to fight) with 10 000 items: yours: 0.0167s mine: 0.0167s
with 100 000 items: yours: 0.2333s mine: 0.2167s with 1 000 000 items: yours: 2.2500s mine: 2.1000s with 10 000 000 items: yours: 38.2500s(first call) - 28.2s(subsequent calls) mine: 21.2500s(first call) - 20.95s(subsequent calls) I guess that the big difference between first call and subsequent calls is due to the fact that your using 2 lists instead of just one. Let's call it even. 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!]
