Data structure: sort

1. Sorting According to the number of records to be sorted, the storage involved in the sorting process is different. Sorting methods are divided into two categories:
[Internal sorting] : The records to be sorted are stored in the computer's random memory for sorting
[External sorting] : To be sorted The number of sorted records is so large that the memory cannot hold all the records at one time, and external storage is needed for access during the sorting process

According to the stability, the sorting method is divided into
[stability sorting] :

In layman's terms, it is guaranteed that the two equal numbers before sorting have the same order in the front and back positions of the sequence and after sorting. In simplification, if Ai = Aj, Ai was originally in front of the position, after sorting, Ai still has to be before the position of Aj.

Stable sorting algorithm

【Unstable Sort】

  • Hill sort:
  • Selection order:
  • Quick sort
  • Heap sort:

Write picture description here

Guess you like

Origin blog.csdn.net/sinat_35803474/article/details/70238179