Lecture12-quicksortavg-matrixmult

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full Document Right Arrow Icon
Announcements § Project #3 § You sent me your chosen theorem, right? § Help session: Thursday at 5pm in 1066 TMCB § Scope: 1-1.5 pages
Background image of page 2
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
Background image of page 3

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

View Full Document Right Arrow Icon
Objectives § Complete the proof of the average case analysis of Quicksort § Apply divide and conquer to matrix multiplication § Analyze using the Master Theorem
Background image of page 4
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 = =
Background image of page 5

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

View Full Document Right Arrow Icon
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 = = = = = = + - + - = + - + - = + - + -
Background image of page 6
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
Background image of page 7

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

View Full Document Right Arrow Icon
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
Background image of page 8
Image of page 9
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 Right Arrow Icon
Ask a homework question - tutors are online