Worst Case Comparisons is equal to height of decision tree

Lower bound on the worst case running time is the lower bound on the
height of the decision tree.

Note that the number of leaves in the decision tree n!, where n = number elements in the input sequence.

A binary tree of height h has leaves.

n!

By Stirling Approximation n! =

Thus n! >(*n*/*e*)^{n}, h
*lg* (*n*/*e*)^{n} = nlgn - nlge =

h lg(n!)

h =

The best possible worst case running time for comparison sorts is thus
nlgn.

Heapsort and Mergesort, both of which are O(nlgn), are asymptotically optimal.