Expected Linear Time Sorting for Word Size Ω(log2n loglogn)

  • Djamal Belazzougui
  • Gerth Stølting Brodal
  • Jesper Sindahl Nielsen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8503)


Sorting n integers in the word-RAM model is a fundamental problem and a long-standing open problem is whether integer sorting is possible in linear time when the word size is ω(logn). In this paper we give an algorithm for sorting integers in expected linear time when the word size is Ω(log2 n loglogn). Previously expected linear time sorting was only possible for word size Ω(log2 + ε n). Part of our construction is a new packed sorting algorithm that sorts n integers of w/b-bits packed in \({\mathcal O}(n/b)\) words, where b is the number of integers packed in a word of size w bits. The packed sorting algorithm runs in expected \({\mathcal O}(\tfrac{n}{b}(\log n + \log^2 b))\) time.


Hash Function Outgoing Edge Sorting Algorithm Word Size Input Word 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ajtai, M., Komlós, J., Szemerédi, E.: An \(\mathcal{O}(n \log n)\) sorting network. In: STOC, pp. 1–9 (1983)Google Scholar
  2. 2.
    Albers, S., Hagerup, T.: Improved parallel integer sorting without concurrent writing. Inf. Comput. 136(1), 25–51 (1997)CrossRefzbMATHMathSciNetGoogle Scholar
  3. 3.
    Andersson, A., Hagerup, T., Nilsson, S., Raman, R.: Sorting in linear time? Journal of Computer and System Sciences 57, 74–93 (1998)CrossRefzbMATHMathSciNetGoogle Scholar
  4. 4.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press and McGraw Hill (2009)Google Scholar
  5. 5.
    Dietzfelbinger, M., Hagerup, T., Katajainen, J., Penttonen, M.: A reliable randomized algorithm for the closest-pair problem. J. Algorithms 25(1), 19–51 (1997)CrossRefzbMATHMathSciNetGoogle Scholar
  6. 6.
    Ferragina, P., Grossi, R.: The string B-tree: A new data structure for string search in external memory and its applications. J. ACM 46(2), 236–280 (1999)CrossRefzbMATHMathSciNetGoogle Scholar
  7. 7.
    Goodrich, M.T.: Randomized shellsort: A simple data-oblivious sorting algorithm. J. ACM 58(6), 27 (2011)CrossRefMathSciNetGoogle Scholar
  8. 8.
    Goodrich, M.T.: Zig-zag sort: A simple deterministic data-oblivious sorting algorithm running in \(\mathcal{O}(n \log n)\) time. CoRR, abs/1403.2777 (2014)Google Scholar
  9. 9.
    Hagerup, T.: Sorting and searching on the word RAM. In: STACS, pp. 366–398 (1998)Google Scholar
  10. 10.
    Han, Y., Thorup, M.: Integer sorting in \(\mathcal{O}(n \sqrt{\log \log n})\) expected time and linear space. In: FOCS, pp. 135–144 (2002)Google Scholar
  11. 11.
    Kirkpatrick, D., Reisch, S.: Upper bounds for sorting integers on random access machines. Theoretical Computer Science 28(3), 263–276 (1983)CrossRefMathSciNetGoogle Scholar
  12. 12.
    Knuth, D.E.: The Art of Computer Programming, volume 4A: Combinatorial Algorithms. Addison-Wesley Professional (2011)Google Scholar
  13. 13.
    Leighton, F.T.: Introduction to Parallel Algorithms and Architectures: Arrays, Trees, Hypercubes. In: Packing, Spreading, and Monotone Routing Problems, ch. 3.4.3, Morgan Kaufmann Publishers, Inc. (1991)Google Scholar
  14. 14.
    Leighton, T., Plaxton, C.G.: Hypercubic sorting networks. SIAM Journal on Computing 27(1), 1–47 (1998)CrossRefzbMATHMathSciNetGoogle Scholar
  15. 15.
    Thorup, M.: On RAM priority queues. SIAM J. Comput. 30(1), 86–109 (2000)CrossRefzbMATHMathSciNetGoogle Scholar
  16. 16.
    Thorup, M.: Randomized sorting in \(\mathcal{O}(n \log \log n)\) time and linear space using addition, shift, and bit-wise boolean operations. J. Alg. 42(2), 205–230 (2002)Google Scholar
  17. 17.
    van Emde Boas, P.: Preserving order in a forest in less than logarithmic time. In: FOCS, pp. 75–84 (1975)Google Scholar
  18. 18.
    Willard, D.E.: Log-logarithmic worst-case range queries are possible in space Θ(n). Inf. Process. Lett. 17(2), 81–84 (1983)Google Scholar
  19. 19.
    Williams, J.W.J.: Algorithm 232: Heapsort. CACM 7(6), 347–348 (1964)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2014

Authors and Affiliations

  • Djamal Belazzougui
    • 1
  • Gerth Stølting Brodal
    • 2
  • Jesper Sindahl Nielsen
    • 2
  1. 1.Helsinki Institute for Information Technology (hiit), Department of Computer ScienceUniversity of HelsinkiFinland
  2. 2.MADALGO, Department of Computer ScienceAarhus UniversityDenmark

Personalised recommendations