DOI QR코드

DOI QR Code

빠른 계수 정렬법의 제안

Proposal of Fast Counting Sort

  • 이상운 (강릉원주대학교 과학기술대학 멀티미디어공학과)
  • Lee, Sang-Un (Dept. of Multimedia Eng., Gangneung-Wonju National University)
  • 투고 : 2015.03.24
  • 심사 : 2015.10.09
  • 발행 : 2015.10.31

초록

데이터를 비교 정렬하는 방법들 중 O(nlogn)보다 빠른 방법은 알려져 있지 않고 있으며, 가장 빠른 퀵 정렬법은 최적과 평균의 경우 O(nlogn), 최악의 경우 $O(n^2)$ 수행 복잡도를 갖고 있다. 본 논문은 비교 정렬법이 아닌 O(n+k),(k=최대치)의 계수 정렬법을 보다 빠르게 수행하는 O(n+k)의 단순 계수정렬법과 데이터의 자리 수 l의 숫자별 빈도수를 계수하여 해당 가상 버킷에 저장하는 O(ln)의 기수 계수 정렬법을 제안하였다. 6개의 실험 데이터에 제안된 알고리즘을 적용한 결과, 퀵 정렬의 O(nlogn) 또는 $O(n^2)$을 O(n+k) 또는 O(ln)으로 단순화 시킬 수 있었다. 결론적으로 제안된 방법은 계수정렬법과 퀵 정렬법에 비해 보다 빠른 방법이다.

Among comparison sorts, no algorithm excels a current set lower bound of O(nlogn) in operation. Quicksort, the fastest of its kind, has a complexity of O(nlogn) at its best and on average and $O(n^2)$ at worst. This paper thus presents two methods: first is an O(n+k) simple counting sort which operates much more speedily than an O(n+k), (k=maximum value) counting sort, and second is an O(ln) radix counting sort which counts the frequency of numbers in the digit l of a data and saves it in a corresponding virtual bucket in an array, only to virtually divide the array into radix digit numbers. For the 6 experimental data, the proposed algorithm makes O(nlogn) or $O(n^2)$ of Quicksort simple into O(n+k) or O(ln). After all, the proposed sorting algorithm has proved to be much faster than the counting sort and Quicksort.

키워드

참고문헌

  1. T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, "Introduction to Algorithms, MIT Press, ISBN: 9780262033848, 2005.
  2. D. B. Ring, "A Comparison of Sorting Algorithms", http://www.devx.com/vb2themax/Article/19900, 2003.
  3. R. Sedgewick, "Algorithms in C, Parts 1-4: Fundamentals, Data Structures, Sorting, Searching", 3rd Ed., Addison-Wesley, ISBN-13: 978-0201314526, 1998.
  4. S. Nilson, "The Fastest Sorting Algorithm?", Dr. Dobb's Journal, Vol. 311, pp. 38-45, Apr. 2000.
  5. P. Indyk and C. Wenk, "CS445: Introduction to Algorithms, Sorting in Linear Time", Dept. of Computer Science, The University of Arizona, 2007.
  6. H. W. Lang, "Sequential and Parallel Sorting Algorithms: Quicksort," FH Flensberg, 2011.
  7. C. A. R. Hoare, "Quicksort", The Computer Journal, Vol. 5, No. 1, pp. 10-16, doi:10.1093/comjnl/5.1.10, 1962.