Sorting algorithm is 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 to sort data records in memory, while external sorting is because the sorted data is very large and cannot accommodate all the sorted records at one time. During the sorting process, external memory needs to be accessed. Common internal sorting algorithms include: insertion sort, Hill sort, selection sort, bubble sort, merge sort, quick sort, heap sort, radix sort, etc. Summarize it with a picture:
Regarding time complexity :
Regarding stability :
Stable sorting algorithms: bubble sort, insertion sort, merge sort and radix sort.
Not stable sorting algorithms: selection sort, quick sort, Hill sort, heap sort.
Glossary :
n : data size
k : the number of "buckets"
In-place : occupies constant memory and does not occupy additional memory
Out-place : takes up additional memory
Stability : The order of two equal key values after sorting is the same as their order before sorting.
GitBook content outline
The content of this book comes almost entirely from the Internet.
Open source project address: https://github.com/hustcc/JS-Sorting-Algorithm, organized by hustcc.
GitBook online reading address: https://sort.hust.cc/.
This project uses lint-md to check the format of Chinese Markdown files. Be sure to ensure that the Markdown format is correct before submitting the PR.