Lecture11-quicksortavg

# Values of random variable 1 2 3 1 3 2 2 1 3 2 3 1 3 1

• Notes
• 39

This preview shows page 30 - 34 out of 39 pages.

Values of Random Variable 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 Runtime on given input t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step

Subscribe to view the full document.

Quicksort: Average Case Analysis § What is the probability distribution? Probability 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 1/n! 1/n! 1/n! 1/n! 1/n! 1/n! t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step Values of Random Variable Uniform
Quicksort: Average Case Analysis § Without loss of generality, Choose first element as pivot Probability Pivot Value 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 1/n! 1/n! 1/n! 1/n! 1/n! 1/n! t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step 1 1 2 2 3 3 Value of Random Variable

Subscribe to view the full document.

Quicksort: Average Case Analysis § Do the pivot Probability Pivot Location 1 2 3 1 3 2 1 2 3 1 2 3 1 2 3 2 1 3 1/n! 1/n! 1/n! 1/n! 1/n! 1/n! t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step t(left of pivot)+t(right of pivot) + linear pivot step
You've reached the end of this preview.
• Spring '08
• Jones,M
• Probability theory, linear pivot step

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern