Types of Sorts

Ace your homework & exams now with Quizwiz!

Slow process using a loop. Best Case: O(N) Avg/Worst Cases: O(N^2)

Bubble Sort

Bubble Sort

Compares side-by-side values by looping through a list.

Best used to verify a sorted list. Best Case: O(N) Avg/Worst Cases: O(N^2)

Insertion Sort

Efficient process, however requires 2x the memory. All cases O(N logN)

Merge Sort

Recursive process using partitions. Best/Avg Case: O(N logN) Worst Case: O(N^2)

Quick Sort

Quick Sort

Recursive process that creates two partitions and moves values around a pivot point, then chooses a new pivot point and repeats the processes.

Merge Sort

Repeatedly divides the data in half, sorts each half, and combines the sorted halves into a sorted whole using a recursive split process.

Slow process using nested loop. All Cases: O(N^2)

Selection Sort

Selection Sort

Used nested loop process to systematically check for correct order of values by swapping two values to make sure they are in their best position.

Insertion Sort

Uses a nested loop to find the best place for the next value in an unsorted part of a list by inserting a new a value each pass.


Related study sets

Chapter 4: The Economy & Family Life

View Set

Ch 11: Exploring Earth's Interior

View Set

Characteristics of teeth (Week 3)

View Set

Is it a reason or evidence? Reasons support the topic. Evidence is your PROOF: an example, fact, statistic, quote, etc.

View Set