Skip to main content

Radix Sorting with No Extra Space

  • Conference paper
Algorithms – ESA 2007 (ESA 2007)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4698))

Included in the following conference series:

Abstract

It is well known that n integers in the range [1,n c] can be sorted in O(n) time in the RAM model using radix sorting. More generally, integers in any range [1,U] can be sorted in \(O(n\sqrt{\log\log n})\) time [5]. However, these algorithms use O(n) words of extra memory. Is this necessary?

We present a simple, stable, integer sorting algorithm for words of size O(logn), which works in O(n) time and uses only O(1) words of extra memory on a RAM model. This is the integer sorting case most useful in practice. We extend this result with same bounds to the case when the keys are read-only, which is of theoretical interest. Another interesting question is the case of arbitrary c. Here we present a black-box transformation from any RAM sorting algorithm to a sorting algorithm which uses only O(1) extra space and has the same running time. This settles the complexity of in-place sorting in terms of the complexity of sorting.

A full version of this paper is available as arXiv:0706.4107.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Andersson, A., Hagerup, T., Nilsson, S., Raman, R.: Sorting in linear time? Journal of Computer and System Sciences 57(1), 74–93 (1998)

    Article  MATH  Google Scholar 

  2. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms. MIT Press, Cambridge (2001)

    MATH  Google Scholar 

  3. Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. System Sci. 47, 424–436 (1993)

    Article  MATH  Google Scholar 

  4. Fredman, M.L., Willard, D.E.: Trans-dichotomous algorithms for minimum spanning trees and shortest paths. J. Comput. System Sci. 48(3), 533–551 (1994)

    Article  MATH  Google Scholar 

  5. Han, Y., Thorup, M.: Integer sorting in \(O(n \sqrt{\log \log n})\) expected time and linear space. In: FOCS, pp. 135–144. IEEE Computer Society, Los Alamitos (2002)

    Google Scholar 

  6. Katajainen, J., Pasanen, T.: Stable minimum space partitioning in linear time. BIT 32(4), 580–585 (1992)

    Article  MATH  Google Scholar 

  7. Katajainen, J., Pasanen, T.: Sorting multisets stably in minimum space. Acta Informatica 31(4), 301–313 (1994)

    Article  MATH  Google Scholar 

  8. Kronrod, M.A.: Optimal ordering algorithm without operational field. Soviet Math. Dokl. 10, 744–746 (1969)

    MATH  Google Scholar 

  9. Munro, J.I.: An implicit data structure supporting insertion, deletion, and search in O(log2 n) time. Journal of Computer and System Sciences 33(1), 66–74 (1986)

    Article  MATH  Google Scholar 

  10. Salowe, J., Steiger, W.: Simplified stable merging tasks. Journal of Algorithms 8(4), 557–571 (1987)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Lars Arge Michael Hoffmann Emo Welzl

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Franceschini, G., Muthukrishnan, S., Pǎtraşcu, M. (2007). Radix Sorting with No Extra Space. In: Arge, L., Hoffmann, M., Welzl, E. (eds) Algorithms – ESA 2007. ESA 2007. Lecture Notes in Computer Science, vol 4698. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-75520-3_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-75520-3_19

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-75519-7

  • Online ISBN: 978-3-540-75520-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics