This paper proposes a 2-element insertion sort algorithm, an improved algorithm on the direct insertion sort, gives the algorithm design idea and the description in C. After analyzes comparatively the time complexity and space complexity of the algorithms, the paper summarizes the pros and cons of the 2-element insertion sort algorithm compared with the original one, so as to giving a theoretical basis for the direct insertion sort algorithm optimization, and playing a guiding role in teaching the relevant chapters in “Data Structure” curriculum.
| Year | Citations | |
|---|---|---|
Page 1
Page 1