|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Getting the intersection of n collections.by jdporter (Canon) |
| on Oct 11, 2006 at 14:17 UTC ( #577610=note: print w/ replies, xml ) | Need Help?? |
|
I point out that solutions which perform set unions pair-wise, iteratively on the set of lists do not scale well. Consider the worst-case scenario, where all of the lists are identical, and there's a million of them. A better approach is the counting one, like that suggested by dtr, but uniqifying each list by converting it to its corresponding set hash, as basje did.
We're building the house of the future together.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||