understanding of lower bound for comparison-based sorting algorithm
问题 First, I know lower bound is O(nlogn) and how to prove it And I agree the lower bound should be O(nlogn). What I don't quite understand is: For some special cases, the # of comparisons could actually be even lower than the lower bound. For example, use bubble sort to sort an already sorted array. The # of comparisons is O(n). So how to actually understand the idea of lower bound ? The classical definition on Wikipedial: http://en.wikipedia.org/wiki/Upper_and_lower_bounds does not help much.