The shortest possible sheet depth in the decision tree (sort comparison algorithm)

What is the shortest possible sheet depth in the decision tree that references the comparison sorting algorithm ?

Does it change depending on the alogram?

+4
source share
1 answer

The absolute best case happens when we simply check each element and see that the data is already sorted.

This will lead to comparisons n-1, and thus the sheet will have depth n-1.

In practice, this happens for insertion sort (this is not so good if it is not).

?

. - - O (n log n) - O (n) .

+6

All Articles