摘要
冒泡排序是一种常见的单向的交换排序,而鸡尾酒排序是在冒泡排序的基础上进行改进的一种双向的交换排序,其每一趟排序都可以将当前的最大值和最小值放置到正确的位置.传统的鸡尾酒排序算法即使引入了标志是否交换的变量来记录前一趟数据是否发生交换从而确定排序是否结束,也无法处理前一趟排序有数据交换但是某些连续的数据存储子区间无交换的情况.为了有效降低不必要的比较,引入了一种鸡尾酒排序算法的改进算法.
Bubble sort is one of the popular and one-way swapping sorts, while cocktail sort, with the purpose of placing the current maximum and minimum correctly, is a bidirectional swapping sort based on bubble sort. Although conditional cocktail sort can use a variable to record whether swapping has happened in the former round so that it can make a decision that the data has been sorted. However, it can't handle this problem when swapping happens in the former round but there's no swapping in the continuous interval. Improvement has been made in cocktail sort in order to reduce the unnecessary comparison.
出处
《宁德师范学院学报(自然科学版)》
2012年第4期371-376,共6页
Journal of Ningde Normal University(Natural Science)