feb9 - Illinois Institute of Technology Department of...

Info icon This 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 fixed 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
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern