首页 | 本学科首页   官方微博 | 高级检索  
     检索      


A select and insert sorting algorithm
Authors:István Beck  Stein Krogdahl
Institution:(1) Department of Mathematics and Computer Sciences, University of Haifa, 31999 Haifa, Israel;(2) Department of Informatics, University of Oslo, Box 1080, Blindern, 0316 Oslo 3, Norway;(3) Present address: Department of Informatics, University of Oslo, Box 1080 Blindern, 0316 Oslo 3, Norway
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 ldquoquasi-randomrdquo 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.
Keywords:F  2  2  G  2  1
本文献已被 SpringerLink 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号