1.0 Top 10 Classic Sorting Algorithms
Category Algorithm
>
This series of algorithms is organized from: https://github.com/hustcc/JS-Sorting-Algorithm
It also refers to Wikipedia for some supplements.
Sorting algorithms are one of the most basic algorithms in "Data Structures and Algorithms."
Sorting algorithms can be divided into internal sorting and external sorting. Internal sorting is sorting data records in memory, while external sorting is due to the large amount of data for sorting, which cannot accommodate all sorting records at once, and requires access to external storage during the sorting process. Common internal sorting algorithms include: insertion sort, shell sort, selection sort, bubble sort, merge sort, quick sort, heap sort, radix sort, etc. Summarized in one picture:
Click the following image to view the large picture:
About Time Complexity
Quadratic (O(n^2)) sorting Various simple sorting: direct insertion, direct selection, and bubble sort.
Linear logarithmic (O(nlog2n)) sorting Quick sort, heap sort, and merge sort;
O(n1+§)) sorting, where § is a constant between 0 and 1. Shell sort
Linear (O(n)) sorting Radix sort, in addition, there are bucket, box sorting.
About Stability
Stable sorting algorithms: bubble sort, insertion sort, merge sort, and radix sort.
Unstable sorting algorithms: selection sort, quick sort, shell sort, heap sort.
Terminology Explanation:
n: Data scale
k: Number of "buckets"
In-place: Occupies constant memory, does not occupy additional memory
Out-place: Occupies additional memory
Stability: After sorting, the order of 2 equal key values is the same as their order before sorting
Includes the following:
**Click here to share notes
-
-
-
1.0 Top 10 Classic Sorting Algorithms