摘要
根据冒泡排序算法的基本原理,对冒泡排序算法进行了一定的改进,使每一趟循环从只能确定一个最大数或最小数,改进为可以确定最大、最小两个数,通过设置监视哨,使循环在序列已有序时及时退出,从而减少循环次数,降低时间复杂度,优化算法。
According to its basic principle, the bubble sort algorithm is improved---each cycle of such algorithm, which used to determine a maximum or a minimum number,can determine both the maximum and minimum numbers at the same time.In order to make circulation exit timely when the sequence has its order,the times of circulation and time complexity will be reduced and the algorithm will be optimized by setting the surveillance.
出处
《电子测试》
2014年第3期48-49,43,共3页
Electronic Test
关键词
排序
时间复杂度
算法
bubble sort
time complexity
algorithm