SlideShare a Scribd company logo
1 of 27
Download to read offline
CS 332: Algorithms Quicksort
Review: Analyzing Quicksort ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Review: Analyzing Quicksort ,[object Object],[object Object],[object Object],[object Object],[object Object]
Review: Analyzing Quicksort ,[object Object],[object Object],[object Object],[object Object]
Review: Analyzing Quicksort (Average Case) ,[object Object],[object Object],[object Object],[object Object]
Review: Analyzing Quicksort (Average Case) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Review: Analyzing Quicksort (Average Case) ,[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],Write it on  the board
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Analyzing Quicksort: Average Case Note: leaving the same recurrence as the book What are we doing here? The recurrence to be solved What are we doing here? What are we doing here? Plug in inductive hypothesis Expand out the k=0 case 2b/n is just a constant,  so fold it into   (n)
Analyzing Quicksort: Average Case What are we doing here? What are we doing here? Evaluate the summation:  b+b+…+b = b (n-1) The recurrence to be solved Since n-1<n, 2b(n-1)/n < 2b What are we doing here? Distribute the summation This summation gets its own set of slides later
Analyzing Quicksort: Average Case How did we do this? Pick a large enough that an/4 dominates   (n)+b  What are we doing here? Remember, our goal is to get T(n)    an  lg  n + b What the hell? We’ll prove this later What are we doing here? Distribute the (2a/n) term The recurrence to be solved
Analyzing Quicksort: Average Case ,[object Object],[object Object],[object Object],[object Object],[object Object]
Tightly Bounding  The Key Summation What are we doing here? The  lg  k in the second term is bounded by  lg  n What are we doing here? Move the  lg  n outside the summation What are we doing here? Split the summation for a tighter bound
Tightly Bounding The Key Summation The summation bound so far What are we doing here? The  lg  k in the first term is bounded by  lg  n/2 What are we doing here? lg  n/2 =  lg  n  - 1 What are we doing here? Move ( lg  n  - 1 ) outside the summation
Tightly Bounding The Key Summation The summation bound so far What are we doing here? Distribute the ( lg  n  - 1 ) What are we doing here? The summations overlap in  range; combine them What are we doing here? The Guassian series
Tightly Bounding  The Key Summation The summation bound so far What are we doing here? Rearrange first term, place upper bound on second What are we doing? X Guassian series What are we doing? Multiply it  all out
Tightly Bounding  The Key Summation

More Related Content

What's hot

Sienna 4 divideandconquer
Sienna 4 divideandconquerSienna 4 divideandconquer
Sienna 4 divideandconquerchidabdu
 
Retarded potential
Retarded potentialRetarded potential
Retarded potentialSVBIT
 
Potentials and fields
Potentials and fieldsPotentials and fields
Potentials and fieldsAvie Tavianna
 
Differential equations final -mams
Differential equations final -mamsDifferential equations final -mams
Differential equations final -mamsarmanimams
 
Integration basics
Integration basicsIntegration basics
Integration basicsTarun Gehlot
 
Skiena algorithm 2007 lecture08 quicksort
Skiena algorithm 2007 lecture08 quicksortSkiena algorithm 2007 lecture08 quicksort
Skiena algorithm 2007 lecture08 quicksortzukun
 
annals-v181-n1-p06-p
annals-v181-n1-p06-pannals-v181-n1-p06-p
annals-v181-n1-p06-pRobert Hough
 
Application of laplace transform
Application of laplace transformApplication of laplace transform
Application of laplace transformAshishbaruah4
 
Persamaan schroedinger bebas waktu
Persamaan schroedinger bebas waktuPersamaan schroedinger bebas waktu
Persamaan schroedinger bebas waktuFani Diamanti
 
Probabilistic group theory, combinatorics, and computing
Probabilistic group theory, combinatorics, and computingProbabilistic group theory, combinatorics, and computing
Probabilistic group theory, combinatorics, and computingSpringer
 
Foundation of KL Divergence
Foundation of KL DivergenceFoundation of KL Divergence
Foundation of KL DivergenceNatan Katz
 

What's hot (20)

Sienna 4 divideandconquer
Sienna 4 divideandconquerSienna 4 divideandconquer
Sienna 4 divideandconquer
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Retarded potential
Retarded potentialRetarded potential
Retarded potential
 
Potentials and fields
Potentials and fieldsPotentials and fields
Potentials and fields
 
Mechanical Engineering Assignment Help
Mechanical Engineering Assignment HelpMechanical Engineering Assignment Help
Mechanical Engineering Assignment Help
 
Differential equations final -mams
Differential equations final -mamsDifferential equations final -mams
Differential equations final -mams
 
potential and fields
potential and fieldspotential and fields
potential and fields
 
Integration basics
Integration basicsIntegration basics
Integration basics
 
Skiena algorithm 2007 lecture08 quicksort
Skiena algorithm 2007 lecture08 quicksortSkiena algorithm 2007 lecture08 quicksort
Skiena algorithm 2007 lecture08 quicksort
 
annals-v181-n1-p06-p
annals-v181-n1-p06-pannals-v181-n1-p06-p
annals-v181-n1-p06-p
 
Linear response theory
Linear response theoryLinear response theory
Linear response theory
 
Application of laplace transform
Application of laplace transformApplication of laplace transform
Application of laplace transform
 
Ch7 angular momentum
Ch7 angular momentumCh7 angular momentum
Ch7 angular momentum
 
Persamaan schroedinger bebas waktu
Persamaan schroedinger bebas waktuPersamaan schroedinger bebas waktu
Persamaan schroedinger bebas waktu
 
Cis435 week03
Cis435 week03Cis435 week03
Cis435 week03
 
Reductions
ReductionsReductions
Reductions
 
TLT
TLTTLT
TLT
 
Wave functions
Wave functionsWave functions
Wave functions
 
Probabilistic group theory, combinatorics, and computing
Probabilistic group theory, combinatorics, and computingProbabilistic group theory, combinatorics, and computing
Probabilistic group theory, combinatorics, and computing
 
Foundation of KL Divergence
Foundation of KL DivergenceFoundation of KL Divergence
Foundation of KL Divergence
 

Viewers also liked

Solving recurrences
Solving recurrencesSolving recurrences
Solving recurrencesWaqas Akram
 
Recurrence relations
Recurrence relationsRecurrence relations
Recurrence relationsIIUM
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5Kumar
 
recurrence relations
 recurrence relations recurrence relations
recurrence relationsAnurag Cheela
 
Recurrences
RecurrencesRecurrences
RecurrencesDEVTYPE
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiersIstiak Ahmed
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)jehan1987
 

Viewers also liked (13)

Cis435 week02
Cis435 week02Cis435 week02
Cis435 week02
 
cvjeroendewandel
cvjeroendewandelcvjeroendewandel
cvjeroendewandel
 
Predicate &amp; quantifier
Predicate &amp; quantifierPredicate &amp; quantifier
Predicate &amp; quantifier
 
Solving recurrences
Solving recurrencesSolving recurrences
Solving recurrences
 
Recurrence relation
Recurrence relationRecurrence relation
Recurrence relation
 
Recurrence relations
Recurrence relationsRecurrence relations
Recurrence relations
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5
 
recurrence relations
 recurrence relations recurrence relations
recurrence relations
 
Reccurrence relations
Reccurrence relationsReccurrence relations
Reccurrence relations
 
Recurrences
RecurrencesRecurrences
Recurrences
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
 
Merge sort
Merge sortMerge sort
Merge sort
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 

Similar to lecture 8

Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of QuicksortRajendran
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2S.Shayan Daneshvar
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfAmayJaiswal4
 
T2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxT2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxGadaFarhan
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquerVikas Sharma
 
RECURRENCE EQUATIONS & ANALYZING THEM
RECURRENCE EQUATIONS & ANALYZING THEMRECURRENCE EQUATIONS & ANALYZING THEM
RECURRENCE EQUATIONS & ANALYZING THEMAlpana Ingale
 
Analysis Of Algorithms Ii
Analysis Of Algorithms IiAnalysis Of Algorithms Ii
Analysis Of Algorithms IiSri Prasanna
 
Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Deepak John
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysisPremjeet Roy
 
Skiena algorithm 2007 lecture02 asymptotic notation
Skiena algorithm 2007 lecture02 asymptotic notationSkiena algorithm 2007 lecture02 asymptotic notation
Skiena algorithm 2007 lecture02 asymptotic notationzukun
 

Similar to lecture 8 (20)

Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
lecture7.ppt
lecture7.pptlecture7.ppt
lecture7.ppt
 
lecture8.ppt
lecture8.pptlecture8.ppt
lecture8.ppt
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
big_oh
big_ohbig_oh
big_oh
 
Approx
ApproxApprox
Approx
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
 
probability assignment help (2)
probability assignment help (2)probability assignment help (2)
probability assignment help (2)
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
T2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptxT2311 - Ch 4_Part1.pptx
T2311 - Ch 4_Part1.pptx
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Time complexity
Time complexityTime complexity
Time complexity
 
RECURRENCE EQUATIONS & ANALYZING THEM
RECURRENCE EQUATIONS & ANALYZING THEMRECURRENCE EQUATIONS & ANALYZING THEM
RECURRENCE EQUATIONS & ANALYZING THEM
 
Analysis Of Algorithms Ii
Analysis Of Algorithms IiAnalysis Of Algorithms Ii
Analysis Of Algorithms Ii
 
series.pdf
series.pdfseries.pdf
series.pdf
 
Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1
 
3.pdf
3.pdf3.pdf
3.pdf
 
Quicksort analysis
Quicksort analysisQuicksort analysis
Quicksort analysis
 
Skiena algorithm 2007 lecture02 asymptotic notation
Skiena algorithm 2007 lecture02 asymptotic notationSkiena algorithm 2007 lecture02 asymptotic notation
Skiena algorithm 2007 lecture02 asymptotic notation
 

More from sajinsc

lecture 30
lecture 30lecture 30
lecture 30sajinsc
 
lecture 29
lecture 29lecture 29
lecture 29sajinsc
 
lecture 28
lecture 28lecture 28
lecture 28sajinsc
 
lecture 27
lecture 27lecture 27
lecture 27sajinsc
 
lecture 26
lecture 26lecture 26
lecture 26sajinsc
 
lecture 25
lecture 25lecture 25
lecture 25sajinsc
 
lecture 24
lecture 24lecture 24
lecture 24sajinsc
 
lecture 23
lecture 23lecture 23
lecture 23sajinsc
 
lecture 22
lecture 22lecture 22
lecture 22sajinsc
 
lecture 21
lecture 21lecture 21
lecture 21sajinsc
 
lecture 20
lecture 20lecture 20
lecture 20sajinsc
 
lecture 19
lecture 19lecture 19
lecture 19sajinsc
 
lecture 18
lecture 18lecture 18
lecture 18sajinsc
 
lecture 17
lecture 17lecture 17
lecture 17sajinsc
 
lecture 16
lecture 16lecture 16
lecture 16sajinsc
 
lecture 15
lecture 15lecture 15
lecture 15sajinsc
 
lecture 14
lecture 14lecture 14
lecture 14sajinsc
 
lecture 13
lecture 13lecture 13
lecture 13sajinsc
 
lecture 12
lecture 12lecture 12
lecture 12sajinsc
 
lecture 11
lecture 11lecture 11
lecture 11sajinsc
 

More from sajinsc (20)

lecture 30
lecture 30lecture 30
lecture 30
 
lecture 29
lecture 29lecture 29
lecture 29
 
lecture 28
lecture 28lecture 28
lecture 28
 
lecture 27
lecture 27lecture 27
lecture 27
 
lecture 26
lecture 26lecture 26
lecture 26
 
lecture 25
lecture 25lecture 25
lecture 25
 
lecture 24
lecture 24lecture 24
lecture 24
 
lecture 23
lecture 23lecture 23
lecture 23
 
lecture 22
lecture 22lecture 22
lecture 22
 
lecture 21
lecture 21lecture 21
lecture 21
 
lecture 20
lecture 20lecture 20
lecture 20
 
lecture 19
lecture 19lecture 19
lecture 19
 
lecture 18
lecture 18lecture 18
lecture 18
 
lecture 17
lecture 17lecture 17
lecture 17
 
lecture 16
lecture 16lecture 16
lecture 16
 
lecture 15
lecture 15lecture 15
lecture 15
 
lecture 14
lecture 14lecture 14
lecture 14
 
lecture 13
lecture 13lecture 13
lecture 13
 
lecture 12
lecture 12lecture 12
lecture 12
 
lecture 11
lecture 11lecture 11
lecture 11
 

Recently uploaded

How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?TechSoup
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxKatherine Villaluna
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice documentXsasf Sfdfasd
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxEduSkills OECD
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 

Recently uploaded (20)

How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice document
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptxPISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
PISA-VET launch_El Iza Mohamedou_19 March 2024.pptx
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 

lecture 8

  • 1. CS 332: Algorithms Quicksort
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Analyzing Quicksort: Average Case Note: leaving the same recurrence as the book What are we doing here? The recurrence to be solved What are we doing here? What are we doing here? Plug in inductive hypothesis Expand out the k=0 case 2b/n is just a constant, so fold it into  (n)
  • 20. Analyzing Quicksort: Average Case What are we doing here? What are we doing here? Evaluate the summation: b+b+…+b = b (n-1) The recurrence to be solved Since n-1<n, 2b(n-1)/n < 2b What are we doing here? Distribute the summation This summation gets its own set of slides later
  • 21. Analyzing Quicksort: Average Case How did we do this? Pick a large enough that an/4 dominates  (n)+b What are we doing here? Remember, our goal is to get T(n)  an lg n + b What the hell? We’ll prove this later What are we doing here? Distribute the (2a/n) term The recurrence to be solved
  • 22.
  • 23. Tightly Bounding The Key Summation What are we doing here? The lg k in the second term is bounded by lg n What are we doing here? Move the lg n outside the summation What are we doing here? Split the summation for a tighter bound
  • 24. Tightly Bounding The Key Summation The summation bound so far What are we doing here? The lg k in the first term is bounded by lg n/2 What are we doing here? lg n/2 = lg n - 1 What are we doing here? Move ( lg n - 1 ) outside the summation
  • 25. Tightly Bounding The Key Summation The summation bound so far What are we doing here? Distribute the ( lg n - 1 ) What are we doing here? The summations overlap in range; combine them What are we doing here? The Guassian series
  • 26. Tightly Bounding The Key Summation The summation bound so far What are we doing here? Rearrange first term, place upper bound on second What are we doing? X Guassian series What are we doing? Multiply it all out
  • 27. Tightly Bounding The Key Summation