[sf-perl] Sorting vs. hash
fluxnet at gmail.com
Fri Mar 28 12:49:43 PDT 2008
hash will never be faster then nothing (at least me thinks)
you can benchmark them tho
On Fri, Mar 28, 2008 at 12:44 PM, Neil Heller <nheller at silcon.com> wrote:
> An interesting question came up.
> Suppose you have a large number (> 250k) of strings in an array.
> You wish to eliminate duplicates.
> Is it faster to sort the array and then iterate once through the list
> (writing selected ones to a new array) or write them all into a hash (at
> which time duplicates would be naturally eliminated)?
> Neil Heller
> SanFrancisco-pm mailing list
> SanFrancisco-pm at pm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SanFrancisco-pm