lec10

# lec10 - MIT OpenCourseWare http/ocw.mit.edu 6.006...

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

MIT OpenCourseWare http://ocw.mit.edu 6.006 Introduction to Algorithms Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .

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

View Full Document
Lecture 10 Sorting III: Linear Bounds Linear-Time Sorting 6.006 Spring 2008 Lecture 10: Sorting III: Linear Bounds Linear-Time Sorting Lecture Overview Sorting lower bounds Decision Trees Linear-Time Sorting Counting Sort Readings CLRS 8.1-8.4 Comparison Sorting Insertion sort, merge sort and heap sort are all comparison sorts. The best worst case running time we know is O ( n lg n ). Can we do better? Decision-Tree Example Sort < a 1 ,a 2 , a n > . ··· 1:2 2:3 1:3 1:3 2:3 231 321 312 132 123 213 Figure 1: Decision Tree Each internal node labeled i : j , compare a i and a j , go left if a i a j , go right otherwise. 1
Lecture 10 Sorting III: Linear Bounds Linear-Time Sorting 6.006 Spring 2008 Example Sort < a 1 ,a 2 ,a 3 > = < 9 , 4 , 6 > Each leaf contains a permutation, i.e., a total

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

lec10 - MIT OpenCourseWare http/ocw.mit.edu 6.006...

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

View Full Document
Ask a homework question - tutors are online