Design an efficient algorithm to sort 5 distinct - very large - keys less than 8 comparisons in the worst case. You can\'t use radix sort.
A B C D E A | C D E - 1 Comparison B A C | | E - 1 Comparison B D A / \ B C E - 1 Comparison \ D
E needs 3 comparisons. It should be compared to A, C, D
E
A
C
D
Try A-C-D-E in that order.
A-C-D-E
Overall there will be nine comparisons -- not very performant.