Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Sorting and searching at the library

Sorting and searching at the library

The algorithms librarians use for sorting and searching physical books are a little different from what you learned in school. The reasons for these differences are surprising.

Jason Orendorff

August 12, 2012
Tweet

More Decks by Jason Orendorff

Other Decks in Programming

Transcript

  1. by jason orendorff for hack day, 11 august 2012 at

    the library Saturday, August 11, 12
  2. • humans are not machines • this is not the

    binary search problem? Saturday, August 11, 12
  3. • humans are not machines • this is not the

    binary search problem Saturday, August 11, 12
  4. • humans are not machines • this is not the

    binary search problem • the cost model is wrong Saturday, August 11, 12
  5. • humans are not machines • this is not the

    binary search problem • the cost model is wrong • also: the library cheats Saturday, August 11, 12
  6. merge sort • divide (in half) • sort halves •

    merge bucket sort Saturday, August 11, 12
  7. merge sort • divide (in half) • sort halves •

    merge bucket sort • divide (in bins) Saturday, August 11, 12
  8. merge sort • divide (in half) • sort halves •

    merge bucket sort • divide (in bins) • sort bins Saturday, August 11, 12
  9. merge sort • divide (in half) • sort halves •

    merge bucket sort • divide (in bins) • sort bins • merge done! Saturday, August 11, 12