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

基于选择思想和反序标识的改进冒泡排序算法
引用本文:陈颖频,王灵芝,吴金锋,何丽,陈国文.基于选择思想和反序标识的改进冒泡排序算法[J].泉州师范学院学报,2014(6):89-93.
作者姓名:陈颖频  王灵芝  吴金锋  何丽  陈国文
作者单位:闽南师范大学 物理与信息工程学院,福建 漳州,363000
基金项目:闽南师范大学校级科研项目资助
摘    要:传统冒泡排序算法的时间复杂度高达 O(n2),且冒泡排序算法在排序序列基本有序、无序的情况下,时间复杂度都是相同的,排序效率并不高。文章结合选择排序的算法思想,对冒泡排序进行改进,以期达到减少交换次数的目的。另外,引进一种叫“反序标识符”的变量,从而有效标识在排序过程中的反序情况,可以大大减少排序序列基本有序的比较次数。利用以上两个措施降低传统冒泡排序算法的比较复杂度和交换次数,从而改进冒泡排序算法。

关 键 词:冒泡排序  选择排序  反序标识符  时间复杂度

The Bubble Sort Algorithm Based on Selection Thought and Inverted Sequence Identifier
CHEN Ying-pin,WANG Ling-zhi,WU Jin-feng,HE Li,CHEN Guo-wen.The Bubble Sort Algorithm Based on Selection Thought and Inverted Sequence Identifier[J].Journal of Quanzhou Normal College,2014(6):89-93.
Authors:CHEN Ying-pin  WANG Ling-zhi  WU Jin-feng  HE Li  CHEN Guo-wen
Institution:(College of Physics and Information Engineering, Minnan Normal University,Fujian 363000,China)
Abstract:The time complexity of traditional bubble sort algorism is O(n2 ),and the time complexity of the algorism don’t change under any circumstances,the efficiency of the algrorism is not high.This pa-per combines the thought of selection sort algorithm to reduce the changed times of the traditional bubble sort algorism.Otherwise,this paper brings in a variable which is called “inverted sequence identifier”to identify the inverted case.This variable will reduce the compared times while most elements in the sequence have been sorted beforehand.We can use the two measures to reduce the changed times and compared times of bubble sort algorism and improve the algortism.
Keywords:bubble sort  selection sort  inverted sequence identifier  time complexity
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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