Chapter 10: Sorting, Sets, and Selection Priority Queues

10.1 Merge-Sort

10.1.1 Divide-and-Conquer

MergeSort.pdf 3
Using Divide-and-Conquer for Sorting
MergeSort.pdf 4

Merging Two Sorted Sequences


The Running Time of Merge-Sort

10.1.2 A C++ Implementation of Merge-Sort

html-10.2 (MergeSort)

mergesort.cpp

10.2 The Set ADT

10.2.1 A Simple Set Implementation

Sets.pdf 3

Sets in STL

Using a Sorted Sequence to Implement a Set

Generic Merging as a Template Method Pattern
html-10.4a (Merger1)
html-10.4b (Merger2)

Using Inheritence to Derive Set Operations
html-10.5a (UnionMerger)
html-10.5b (IntersectMerger)
html-10.5c (SubtractMerger)

Performance of Generic Merging


10.3 Quick-Sort

High-Level Description of Quick-Sort
QuickSort.pdf 3-12

10.3.1 In-Place Quick-Sort

html-10.7 (QuickSort)
qsort.cpp

Running Time of Quick-Sort
QuickSort.pdf 13-15

10.3.2 Randomized Quick-Sort


10.4 A Lower Bound on Comparison-Based Sorting

SortingLowerBound.pdf 1-5


10.5 Bucket-Sort and Radix-Sort

10.5.1 Bucket-Sort

RadixSort.pdf  2

Stable Sorting

10.5.2 Radix-Sort

RadixSort.pdf  7


10.6 Comparison of Sorting Algorithms

QuickSort.pdf 18
Insertion-Sort
Merge-Sort
Quick-Sort
Heap-Sort
Bucket-Sort and Radix-Sort