*A smart and interesting sorting.
Suppose I have five elements: a, b, c, d, e. And I want to sort them in 7 steps:
Step 1: 3 comparisons:
if a > b: swap(a, b);
if c > d: swap(c, d);
if b > d: swap(b, d), swap(a, c)

Step 2: 2 comparisons:
now I need to find the position for e in {a, b, d}:
if (e < b)
if (e < a)
e a b d
else
a e b d
else
if (e < d)
a b e d
else
a b d e

Step 3: 2 comparisons
I already know c < d, so I can use step 2’s trick to compare the non-d element. If e is greatter than d, I may have less comparisons.