摘要
排序是计算机科学中基本的研究课题之一,其目的是方便记录的查找、插入和删除.通过描述冒泡、选择、插入、归并和快速5种排序算法,总结了它们的时间复杂性和空间复杂性,指出5种排序算法可分为平方阶排序和线性对数阶排序两类.通过实验验证了5种排序算法在随机、正序和逆序3种情况下的性能,指出排序算法的适用原则:当记录较小时,可采用插入或选择排序;当记录基本有序时,可选用插入或冒泡排序;当记录较大时,则应选择快速排序或归并排序.
Sorting algorithm is one of the most basic research fields in computer science.It's goal is to make record easier to search,insert and delete.Through the description of five sort algorithms: bubble,select,insert,merger and quick,the time and space complexity was summarized.Furthermore,two categories of O(n2) and O(nlogn) could be divided.On the record sequence of random,positive and reverse,the application rules was pointed out based on the experiments.When the size of records is small,insertion sort or selection sort performs well.When the sequence is ordered,insertion sort or bubble sort performs well.When the size of records is large,quick sort or merge sort performs well.
出处
《重庆文理学院学报(自然科学版)》
2010年第3期45-50,共6页
Journal of Chongqing University of Arts and Sciences
基金
云南省2009年社会发展科技计划项目(2009ZC128M)