Download presentation
Presentation is loading. Please wait.
1
Lecture 3 Sorting and Selection
2
Comparison Sort
3
Decision Tree
4
Running Time Is there a faster sorting of other type?
5
Counting sort
8
Counting sort (Running Time)
9
A Student’s Variation
10
Counting sort is stable.
That is, the same value appear in the output array in the same order as they do in the input array.
11
Radix Sort
12
Running Time
13
An Application: Selection Problem
14
If we use comparison, what is the lower bound?
15
Randomized Selection
16
Running time
17
Selection with O(n) Comparisons
21
Why? See next page!!!
22
( + low side) contains red part
( high side) contains blue part
23
Analysis
24
Analysis basis induction
26
What we learnt in this lecture?
What is “comparison sort”?. Lower bound for comparison sort. Counting sort and Radix sort. What is selection problem? expected linear time and linear time selections.
27
Puzzle
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.