Unit 9: Searching and Sorting Algorithms Flashcards
A sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part.
Sortion Algorithm.
[3, 4, 2, 5, 1] –> [1, 2, 3, 4, 5]
A sorting algorithm that treats the input as two parts, sorted and unsorted, and repeatedly inserts the next value from the unsorted part into the correct location in the sorted part.
Insertion Sort Algorithm
Keeps checking previous indices until current value is not less than previous value or until current index equals 0 if less than all previous values.
A sorting algorithm that repeatedly partitions the input into low and high parts (each unsorted), and then recursively sorts each of those parts. To partition the input, _____ chooses a pivot to divide the data into low and high parts
Quick sort algorithm
The ___ can be any value within the sorted array, commonly the value of the middle array element.
Pivot
All values in the ________ are less than or equal to the pivot value.
Low partition