hash will never be faster then nothing (at least me thinks)<br>you can benchmark them tho<br><br><div class="gmail_quote">On Fri, Mar 28, 2008 at 12:44 PM, Neil Heller &lt;<a href="mailto:nheller@silcon.com">nheller@silcon.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
An interesting question came up.<br>
<br>
Suppose you have a large number (&gt; 250k) of strings in an array.<br>
You wish to eliminate duplicates.<br>
<br>
Is it faster to sort the array and then iterate once through the list<br>
(writing selected ones to a new array) or write them all into a hash (at<br>
which time duplicates would be naturally eliminated)?<br>
<br>
Neil Heller<br>
<br>
<br>
_______________________________________________<br>
SanFrancisco-pm mailing list<br>
<a href="mailto:SanFrancisco-pm@pm.org">SanFrancisco-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/sanfrancisco-pm" target="_blank">http://mail.pm.org/mailman/listinfo/sanfrancisco-pm</a><br>
</blockquote></div><br>