Lecture12-quicksortavg-matrixmult

# Lecture12-quicksortavg-matrixmult - This work is licensed...

This preview shows pages 1–9. Sign up to view the full content.

CS 312: Algorithm Analysis Lecture #12: Average Case Analysis of Quicksort (2); This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, Sean Warnick

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

View Full Document
Announcements § Project #3 § You sent me your chosen theorem, right? § Help session: Thursday at 5pm in 1066 TMCB § Scope: 1-1.5 pages
Plan Your Career! § Career Fair Preview § Wednesday, Feb. 1 § 5:00 p.m. § in 1170 TMCB § BYU Technical Career Fair § Thursday, Feb. 2 § 9 a.m. to 3 p.m. § Wilkinson Center Ballroom

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

View Full Document
Objectives § Complete the proof of the average case analysis of Quicksort § Apply divide and conquer to matrix multiplication § Analyze using the Master Theorem
Quicksort: Average Case Analysis [ ] 1 1 [ ] ( ) ( 1) ( ) n p E X g n t p t n p n = = + - + - [ ] 1 1 [ ] ( 1) ( ) ( ) n p E X t p t n p g n n = = - + - + ( ) [ ] ( ) x t n E X p x x = =

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

View Full Document
Quicksort: Average Case Analysis [ ] [ ] 1 1 1 1 1 ( ) [ ] ( ) ( 1) ( ) 1 ( ) ( 1) ( ) 1 ( ) ( 1) ( ) n p n p n n p p t n E X g n t p t n p n g n t p t n p n g n t p t n p n = = = = = = + - + - = + - + - = + - + -
Quicksort: Average Case Analysis Probability (n-1)!/n! = 1/n (n-1)!/n! = 1/n (n-1)!/n! = 1/n t(0)+t(2) + g(n) t(1)+t(1) + g(n) t(2)+t(0) + g(n) 1 2 3 1 2 3 1 2 3 Value of Random Variable

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

View Full Document
Quicksort: Average Case Analysis [ ] [ ] 1 1 1 1 1 1 0 0 1 1 0 0 1 0 1 ( ) [ ] ( ) ( 1) ( ) 1 ( ) ( 1) ( ) 1 ( ) ( 1) ( ) 1 ( ) ( ) ( ) 2 2 ( ) ( ) ( 1) ( ) 2 Thus, ( ) ( ) ( n p n p n n p p n n k k n n k k n k t n E X g n t p t n p n g n t p t n p n
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 33

Lecture12-quicksortavg-matrixmult - This work is licensed...

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

View Full Document
Ask a homework question - tutors are online