兰洋, 尤磊. 一种基于动态交换的计数排序算法[J]. 信阳师范学院学报(自然科学版), 2015, 28(2): 279-282. DOI: 10.3969/j.issn.1003-0972.2015.02.030
引用本文: 兰洋, 尤磊. 一种基于动态交换的计数排序算法[J]. 信阳师范学院学报(自然科学版), 2015, 28(2): 279-282. DOI: 10.3969/j.issn.1003-0972.2015.02.030
Lan Yang , You Lei . A Counting Sort Algorithm Based on Dynamic Exchange[J]. Journal of Xinyang Normal University (Natural Science Edition), 2015, 28(2): 279-282. DOI: 10.3969/j.issn.1003-0972.2015.02.030
Citation: Lan Yang , You Lei . A Counting Sort Algorithm Based on Dynamic Exchange[J]. Journal of Xinyang Normal University (Natural Science Edition), 2015, 28(2): 279-282. DOI: 10.3969/j.issn.1003-0972.2015.02.030

一种基于动态交换的计数排序算法

A Counting Sort Algorithm Based on Dynamic Exchange

  • 摘要: 提出一种动态交换的策略, 对一个元素计数后, 根据计数值的大小将元素移动到序列的合适位置,使得算法在每运算一个元素后, 元素间的排列都是有序的, 计数值大的元素位于序列的前端, 从而有效地减少了查询时间. 分析了算法的时间及空间复杂度, 并通过实验验证了算法的实时性与高效性.

     

    Abstract: To ensure elements were in the proper position after each element was calculated, a dynamic exchange strategy was presented to exchange the element’s position according to the element’s counting value. The element having the bigger counting value was set to the frontier position, which reduces effectively the query time. The complexity of time and space were also analyzed and the real-time and efficiency were verified through the experiment

     

/

返回文章
返回