This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Every possible input permutation must lead to a separate leaf output. If not, some input 45 would have same output ordering as 54, which would be wrong. Since there are n!=1*2**n leaves, the height is at least log (n!) minimum height (time) log ( n !) x i < x j ? x a < x b ? x m < x o ? x p < x q ? x e < x f ? x k < x l ? x c < x d ? n ! (2,4) Trees 2/9/2006 12:42 AM 3 Sorting Lower Bound 5 The Lower Bound Any comparison-based sorting algorithms takes at least log (n!) time Therefore, any such algorithm takes time at least That is, any comparison-based sorting algorithm must run in (n log n) time. ). 2 / ( log ) 2 / ( 2 log ) ! ( log 2 n n n n n =...
View Full Document