How to get the difference between two lists?

Alex Tweedly alex at tweedly.net
Mon Apr 4 13:27:22 EDT 2005


Frank D. Engel, Jr. wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Okay, so anyone want to report on this one (untested, but should be 
> rather efficient):
>
> This algorithm assumes that every item in the exclusion list is 
> included in the master list, that there are no duplicate items in 
> either list, and that both lists are in ascending numeric order:

That assumption isn't met by the earlier test data - so I can't do an 
exact comparison with the earlier cases.

But with 10,000 in the full list, and 1,667 in the smaller list (instead 
of 5000), the times are
new code: 183 ms
difference: 15 ms

Surprising - I expected it to be faster, but I tried a few variants and 
they all had much the same timings.

-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.6 - Release Date: 30/03/2005



More information about the use-livecode mailing list