Whither binary search?

Sion Arrowsmith siona at chiark.greenend.org.uk
Thu Sep 28 11:18:24 EDT 2006


John Machin <sjmachin at lexicon.net> wrote:
>Fredrik Lundh wrote:
>> well, people tend to use dictionaries when they need to look things up
>> quickly...
>... like those paper dictionaries with the words in alphabetical order
>:-)

... where you'll notice that the really big ones are divided up into
buckets (which just happen to be keyed on initial letter).

Truth is that humans are lot better than computers at general
insertion sort, and its lookup equivalent, whereas computers are much
better at calculating hashes. So we each use a dictionary
implementation that plays to our strengths.

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list