function for greatest object in list less than or equal to a value

Mark Waddingham mark at livecode.com
Mon Oct 12 14:02:09 EDT 2015


On 2015-10-12 19:56, dunbarx at aol.com wrote:
> "Sort" is consistently faster, up to 50%. Why "up to"? Try it several
> times. As per the other, newer part of this thread, timing based on
> such things as "ticks" needs to be run many times to get an accurate
> "average" reading. Other system processes come into play, as well as
> gremlins.

The most interesting question here (from a complexity O(n) vs O(nlog n) 
point of view at least) is at what length of list does the 'sort' 
version become slower than the 'repeat' version...

Mathematically, there has to be a minimum length of list for which this 
is true.

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list