skip to main content
research-article

Inversion-sensitive sorting algorithms in practice

Published:23 February 2009Publication History
Skip Abstract Section

Abstract

We study the performance of the most practical inversion-sensitive internal sorting algorithms. Experimental results illustrate that adaptive AVL sort consumes the fewest number of comparisons unless the number of inversions is less than 1%; in such case Splaysort consumes the fewest number of comparisons. On the other hand, the running time of Quicksort is superior unless the number of inversions is less than 1.5%; in such case Splaysort has the shortest running time. Another interesting result is that although the number of cache misses for the cache-optimal Greedysort algorithm was the least, compared to other adaptive sorting algorithms under investigation, it was outperformed by Quicksort.

References

  1. Adelson-Velskii, G., and Landis, E. 1962. On an information organization algorithm. Doklady Akademia Nauk SSSR, 146, 263--266.Google ScholarGoogle Scholar
  2. Brodal, G., Fagerberg, R., and Moruz, G. 2005. On the adaptiveness of Quicksort. Proceedings of the 7th Workshop on Algorithm Engineering and Experiments, Vancouver, B.C., Canada, January 22, pp. 130--140, SIAM.Google ScholarGoogle Scholar
  3. Brodal, G., Fagerberg, R., and Moruz, G. 2005. Cache-aware and cache-oblivious adaptive sorting. Proceedings of the 32nd International Colloquium on Automata, Languages and Programming, Lisboa, Portugal, July 11--15, Lecture Notes on Computer Science 3580, pp. 576--588, Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Cole, R. 2000. On the dynamic finger conjecture for splay trees. Part II: The proof. SIAM Journal on Computing, 30, 44--85. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Cook, R. and Kim, J. 1980. Best sorting algorithms for nearly sorted lists. Communications of the ACM, 23, 620--624. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Dromey, P. 1984. Exploiting partial order with Quicksort. Software: Practice and Experience, 14, 509--518.Google ScholarGoogle ScholarCross RefCross Ref
  7. Elmasry, A. 2004. Adaptive sorting with AVL trees. 18th IFIP World Computer Congress, Proceedings of the 3rd International Conference on Theoretical Computer Science, Toulouse, France, August 23--26, pp. 315--324.Google ScholarGoogle ScholarCross RefCross Ref
  8. Elmasry, A., Jensen, C., and Katajainen, J. Multipartite priority queues. ACM Transactions on Algorithms. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Elmasry, A., Jensen, C., and Katajainen, J. 2004. A framework for speeding up priority queue operations. CPH STL TR 2004-3, Department of Computing, University of Copenhagen.Google ScholarGoogle Scholar
  10. Elmasry, A. 2002. Priority queues, pairing and adaptive sorting. Proceedings of the 29th International Colloquium on Automata, Languages and Programming, Malaga, Spain, July 8--13, Lecture Notes on Computer Science 2380, pp. 183--194, Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Elmasry, A. and Fredman, M. 2008. Adaptive sorting: an information theoretic perspective. Acta Informatica, 45(1), 33--42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Estivill-Castro, V., and Wood, D. 1992. A survey of adaptive sorting algorithms. ACM Computer Surveys, 24(4), 441--476. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Gonnet, G., and Munro, J. I. 1986. Heaps on heaps. SIAM Journal on Computing, 15, 964--971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Guibas, L., Mccreight, E., Plass, M., and Roberts, J. 1977. A new representation for linear lists. Proceedings of the 9th Annual ACM Symposium on Theory of Computing, Atlanta, GA, USA, April 30--May 2, pp. 49--60. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Hoare, C. 1961. Algorithm 64: Quicksort. Communications of the ACM, 4(7), 321. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Knuth, D. 1998. The Art of Computer Programming. Vol III: Sorting and Searching. Addison-wesley, second edition. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Levcopoulos, C., and Peterson, O. 1996. Exploiting few inversions when sorting: Sequential and parallel algorithms. Theoretical Computer Science, 163, 211--238. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Levcopoulos, C., and Peterson, O. 1993. Adaptive Heapsort. Journal of Algorithms, 14, 395--413. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Levcopoulos, C., and Peterson, O. 1991. Splitsort—An adaptive sorting algorithm. Information Processing Letters, 39, 205--211. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Mannila, H. 1985. Measures of presortedness and optimal sorting algorithms. IEEE Transactions on Computers, C-34, 318--325.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Mehlhorn, K. 1979. Sorting presorted files. Proceedings of the 4th GI Conference on Theoretical Computer Science, Aachen, Germany, March 26--28, Lecture Notes on Computer Science 67, pp. 199--212, Springer Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Moffat, A., Eddy, G., and Petersson, O. 1996. Splaysort: Fast, versatile, practical. Software: Practice and Experience, 126(7), 781--797. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Moffat, A. and Petersson, O. 1992. An overview of adaptive sorting. Australian Computer Journal, 24, 70--77.Google ScholarGoogle Scholar
  24. Moffat, A., Petersson, O., and Wormald, N. 1998. A tree-based Mergesort. Acta Informatica, 35(9), 775--793.Google ScholarGoogle ScholarCross RefCross Ref
  25. Sleator, D., and Tarjan, R. 1985. Self-adjusting binary search trees. Journal of the ACM, 32(3), 652--686. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Vuillemin, J. 1980. A unifying look at data structures. Communications of the ACM, 23, 229--239. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Wainwright, R. 1985. A class of sorting algorithms based on Quicksort. Commuications of the ACM, 28(4), 396--402. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Inversion-sensitive sorting algorithms in practice

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                Full Access

                • Published in

                  cover image ACM Journal of Experimental Algorithmics
                  ACM Journal of Experimental Algorithmics  Volume 13, Issue
                  2009
                  482 pages
                  ISSN:1084-6654
                  EISSN:1084-6654
                  DOI:10.1145/1412228
                  Issue’s Table of Contents

                  Copyright © 2009 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 23 February 2009
                  Published in jea Volume 13, Issue

                  Qualifiers

                  • research-article
                  • Research
                  • Refereed

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader