feb9 - Illinois Institute of Technology Department of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Illinois Institute of Technology Department of Computer Science Lecture 6: February 9, 2009 CS 430 Introduction to Algorithms Spring Semester, 2009 1 Lower Bounds on Sorting All of the sorting algorithms that we have seen have been based on element comparisons a i : a j of the items being sorted; all of them use Ω( n log n ) such comparisons. Today we’ll see that this is no coincidence: Any sorting algorithm based on comaprisons of the elements being sorted must use that many element comparisons in both the worst case and on the average. In this discussion we will consider only the case in which no two elements are equal, so such a comparison results in either a > or < answer, never =. Any sorting algorithm that works correctly for all inputs must work for this type of input. For a ±xed value of n , we can take such a sorting algorithm and expand it into a binary decision tree in which internal nodes are the comparisons and leaves are the sorted elements—that is, a leaf corresponds to a permutation of the input elements. For the algorithm to sort correctly, each of the possible n ! permutations must correspond to a unique leaf (if two or more permutations share a leaf, the algorithm cannot have
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/07/2009 for the course CS 430 taught by Professor Kapoor during the Spring '08 term at Illinois Tech.

Page1 / 3

feb9 - Illinois Institute of Technology Department of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online