Sorting AlgorithmsA brief overview of the more common sorting algorithms.
Binary search was efficient when given a pre-sorted data set, but what are the most efficient ways to actually sort data sets? There are many different sorting algorithms, but you are going to focus on three of the most common: bubble sort, merge sort, and quicksort. Each has pros and cons when it comes to their efficiency, as you can see in the table below:
|Best Case||Worst Case||Average Case||Space Complexity|
|Merge Sort||O(n log n)||O(n log n)||O(n log n)||O(n)|
|Quicksort||O(n log n)||O(n log n)||O(n^2)||O(log n)|