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.