Loading page…
A travel app wants a thousand photos ranked by comparing two at a time. Comparing every pair takes almost two months at ten seconds a comparison. Each comparison has two answers, so k comparisons give at most two to the k endings, and a ranking needs one ending for each of the n factorial orders. That puts a floor of about n log n comparisons under every comparison sort, which binary insertion nearly meets. The lesson also covers what the floor does not say: a lucky input, a method that does not compare, and a factorial that wraps.
You work on the photo contest of a travel app.