FastSortsComplexity Flashcards
In-Place definition
A sort that moves elements around elements around an array, original order is lost
Partition definition
Diving an array into two or more parts
Stability definition
whether or no the relative order of equal elements will change as a result of sort
Natural order definition
The desired order of elements when finished sorting
What is Selection Sort?
Look for minimum, swap current element for minimum. After each iter, the min is placed in the front of the unsorted list
What is Merge Sort?
Divide array into sub-arrays, continue diving until the lists only contain one element. Merge sub-arrays back together in sorted order. Continuing merging until all subarrays are merged back in order.
What is Quick Sort?
Choose a pivot value at some index, create two new arrays: less array and greater array with values less and greaters than pivot. Recursively sort both pieces, and then concatenate them back together.