Quicksort - PowerPoint PPT Presentation

About This Presentation
Title:

Quicksort

Description:

Quicksort Analysis of Algorithms * Intuition for the average case Analysis of Algorithms * Intuition for the average case Analysis of Algorithms * Randomized ... – PowerPoint PPT presentation

Number of Views:165
Avg rating:3.0/5.0
Slides: 48
Provided by: IlyasC7
Category:

less

Transcript and Presenter's Notes

Title: Quicksort


1
Quicksort
2
Quicksort Two Partioning Algorithms
3
Hoares Partitioning Algorithm
4
Quicksort
5
Hoares Partitioning Algorithm
6
Hoares Partitioning Algorithm
7
Hoares Partitioning Algorithm
8
Hoares Partitioning Algorithm - Ex1 (pivot5)
9
Hoares Partitioning Algorithm Ex2 (pivot5)
10
Correctness of Hoares Partitioning Algorithm
11
Correctness of Hoares Partitioning Algorithm
12
Correctness of Hoares Partitioning Algorithm
13
Correctness of Hoares Partitioning Algorithm
14
Correctness of Hoares Partitioning Algorithm
15
Correctness of Hoares Partitioning Algorithm
16
Correctness of Hoares Partitioning Algorithm
17
Lomutos Partitioning Algorithm
18
Quiksort Lumutos Algorithm
19
Lomutos Algorithm Example (pivot 4)
20
Lomutos Algorithm Example (pivot 4)
21
Lomutos Algorithm Example (pivot 4)
22
Comparison of Hoares Lomutos Algorithms
23
Comparison of Hoares Lomutos Algorithms
24
Comparison of Hoares Lomutos Algorithms
25
Analysis of Quicksort
26
Worst-case of quicksort
27
Worst-case recursion tree
28
Best-case analysis
29
Analysis of almost-best case
30
Balanced PartitioningsSplits of constant
proportionality
31
(No Transcript)
32
Balanced Partitionings
33
Intuition for the average case
34
Intuition for the average case
35
Intuition for the average case
36
Randomized Quicksort
Average-case assumption all permutations are
equally likely cannot always expect to hold
Alternative to assuming a distribution Impose a
distribution Partition around a random pivot
Typically useful when there are many ways that
an algorithm can proceed but, it is difficult
to determine a way that is guaranteed to be
good. Many good alternatives simply choose one
randomly Running time is independent of input
ordering No specific input causes worst-case
behavior Worst case determined only by output
of random number generator
37
Randomized Quicksort
38
Formal Average - Case Analysis
39
Likelihood of Various Outcomes ofHoares
Partitioning Algorithm
40
Various Outcomes
41
Average - Case Analysis Recurrence
42
Average - Case Analysis Recurrence
43
Solving Recurrence Substitution
44
Tight bound for S klgk
45
Tight bound for S klgk
46
(No Transcript)
47
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com