Abstract
A general sorting algorithm, having the well knownO(n 2) algorithmsStraight Insertion Sort andSelection Sort as special cases, is described. This algorithm is analyzed in the case that certain choices in the algorithm are done randomly, and this yields an algorithm that has an average complexity ofO(n 1.5) and a worst case complexity ofO(n 2). However, making random choices (by some random number generator) is time consuming, and a simple “quasi-random” scheme is therefore implemented. Test runs indicate that also this version has average complexity ofO(n 1.5), and it even seems to perform better than the version using real random choices (even if we disregard the time used for the random choices). This version also needs very little administrative overhead, and it therefore compares favourably to many other sorting algorithms for small and medium sized arrays.
Similar content being viewed by others
References
D. E. Knuth,The Art of Computer Programming, Vol. 1, pp. 95–99, Addison Wesley, 1969.
N. Wirth,Algorithms+Data Structures = Programs, Prentice-Hall, 1976.
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Beck, I., Krogdahl, S. A select and insert sorting algorithm. BIT 28, 725–735 (1988). https://doi.org/10.1007/BF01954893
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF01954893