lec11 - 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

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 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 . Lecture 11 Sorting IV: Stable Sorting, Radix Sort 6.006 Spring 2008 Lecture 11: Sorting IV: Stable Sorting, Radix Sort Lecture Overview Stable Sorting Radix Sort Quick Sort not ocially a part of 6 . 006 Sorting Races Stable Sorting Preserves input order among equal elements 3 * 1 4 counting sort is stable 4 1 4 3 * 4 3 3 merge sort is stable Figure 1: Stability Selection Sort and Heap: Find maximum element and put it at end of array (swap with element at end of array) NOT STABLE! define 2 a <2 b Figure 2: Selection Sort Instability Radix Sort Herman Hollerith card-sorting machine for 1890 census. Digit by Digit sort by mechanical machine 1. Examine given column of each card in a deck 2. Distribute the card into one of 10 bins 1 Lecture 11 Sorting IV: Stable Sorting, Radix...
View Full Document

This note was uploaded on 09/24/2010 for the course CS 6.006 taught by Professor Erikdemaine during the Spring '08 term at MIT.

Page1 / 5

lec11 - 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