Sorting algorithm 1. Concept
The so-called ordering is to make a series of records, according to the size of one or some of the keywords, increment or decrement the arrangement of operations. The sorting algorithm is how to make the records arranged according to the requirements of the method.
2. Select a few references that are commonly used when sorting algorithms a. Stability
Suppose that there are multiple records with the same keyword in a sorted sequence of records, and if sorted, the relative order of the records remains the same, that is, in the original sequence, RI = RJ, and RI is before RJ, and in the sorted sequence, the RI is still before RJ, which is called the sort algorithm is stable;
B. Time complexity c. Spatial complexity 3. Algorithm bubble Sort Select sort Insert Sort Hill sort Quick sort merge sort cardinal sort binary tree sort
iOS Learning notes---sorting algorithm