Searching/Sorting Algorithms Flashcards
Sorting algorithm that treats input as two parts, sorted and unsorted. Uses i and j to repedeatley select the proper next value to swap to the end of the sorted part of the list. j is ahead of i by one index and compares the previous value to the current value. j < i.
Selection Sort
Sorting algorithm that treats input as two parts, sorted and unsorted. Repeatedly inserts the next value from the unsorted part into the correct location in the sorted part. j < j -1
Insertion Sort
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, quicksort chooses a pivot to divide the data into low and high parts.
Quick Sort
Sorting algorithm that divides a list into two halves, recursively sorts each half, and then merges the sorted halves to produce a sorted list. The recursive partitioning continues until a list of one element is reached, as a list of one element is already sorted.
Merge Sort
A sorting algorithm designed specifically for integers. The algorithm makes use of a concept called buckets and is a type of bucket sort.
Any array of integer values can be subdivided into buckets by using the integer values’ digits. A bucket is a collection of integer values that all share a particular digit value
Radix Sort
is a sorting algorithm that treats the input as a collection of interleaved lists, and sorts each list individually with a variant of the insertion sort algorithm. Shell sort uses gap values to determine the number of interleaved lists. A gap value is a positive integer representing the distance between elements in an interleaved list. For each interleaved list, if an element is at index i, the next element is at index i + gap value
Shell Sort
A sorting algorithm that iterates through a list, comparing and swapping adjacent elements if the second element is less than the first element. Bubble sort uses nested loops.
Bubble Sort
A numerical sorting algorithm that distributes numbers into buckets, sorts each bucket with an additional sorting algorithm, and then concatenates buckets together to build the sorted result. A bucket is a container for numerical values in a specific range
Bucket Sort