What is the minimum number of comparisons needed to sort N items?
-
Any sorting algorithm that uses comparisons corresponds to a decision tree.
-
The decision tree must have N! leaves corresponding to all the possible orderings of N items.
-
The height of the tree gives the most number of comparisons the algorithm will have to make.
Bubble sort sometimes makes unnecessary comparisons.
So maybe the height is smaller for some other algorithms.
We need to know the minimum height of a decision tree knowing only that it must have N! leaves, but not assumming any particular sorting algorithm.