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

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

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

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online