260 likes | 268 Views
Explore the time requirements of selection sort, bubble sort, insertion sort, mergesort, quicksort, radix sort, and their growth-rate functions in graphical and tabular forms. Understand worst-case scenarios, recursive calls, partitioning methods, and how these algorithms operate on arrays of varying sizes.
E N D
Figure 9.1 Time requirements as a function of the problem size n
Figure 9.2 When n ≥ 2, 3 * n2 exceeds n2 - 3 * n + 10
Figure 9.3a A comparison of growth-rate functions: a) in tabular form
Figure 9.3b A comparison of growth-rate functions: b) in graphical form
Selection Sort Bubble Sort Insertion Sort Mergesort Quicksort Radix Sort Sorting Algorithms
Figure 9.4 A selection sort of an array of five integers
Figure 9.5 The first two passes of a bubble sort of an array of five integers: a) pass 1; b) pass 2
Figure 9.6 An insertion sort partitions the array into two regions
Figure 9.7 An insertion sort of an array of five integers.
Figure 9.8 A mergesort with an auxiliary temporary array
Figure 9.9 A mergesort of an array of six integers
Figure 9.10 A worst-case instance of the merge step in mergesort
Figure 9.11 Levels of recursive calls to mergesort given an array of eight items
Figure 9.12 A partition about a pivot
Figure 9.13 kSmall versus quicksort
Figure 9.14 Invariant for the partition algorithm
Figure 9.15 Initial state of the array
Figure 9.16 Moving theArray[firstUnknown] into S1 by swapping it with theArray[lastS1+1] and by incrementing both lastS1 and firstUnknown
Figure 9.17 Moving theArray[firstUnknown] into S2 by incrementing firstUnknown
Figure 9.18a Developing the first partition of an array when the pivot is the first item
Figure 9.18b Developing the first partition of an array when the pivot is the first item
Figure 9.19 A worst-case partitioning with quicksort
Figure 9.20 A average-case partitioning with quicksort
Figure 9.21 A radix sort of eight integers
Figure 9.22 Approximate growth rates of time required for eight sorting algorithms