CSE 326: Data Structures
Sorting by Comparison

Sorting by Comparison algorithms

Selection Sort idea

Selection Sort

HeapSort: sorting with a priority queue ADT (heap)

QuickSort

QuickSort Partition

QuickSort Partition (cont’d)

QuickSort
Worst case

Dealing with Slow QuickSorts

QuickSort
Average Case

MergeSort

MergeSort Running Time

Could we do better?*

Best case time

Worst case time

Decision tree to sort list A,B,C

Max depth of the decision tree

Stirling’s approximation

Eine kleine Nachmath