Skip to main content

String Sorting

  • Reference work entry
  • First Online:
Encyclopedia of Algorithms
  • 86 Accesses

Years and Authors of Summarized Original Work

  • 1997; Bentley, Sedgewick

Problem Definition

The problem is to sort a set of strings into lexicographical order. More formally: A string over an alphabet\(\varSigma\)is a finite sequence \(x_{1}x_{2}x_{3}\ldots x_{k}\)where \(x_{i} \in \varSigma\)fori = 1, …, k.Thex i s are called the characters of the string, and k is the length of the string. If the alphabet \(\varSigma\)is ordered, the lexicographical order on the set of strings over \(\varSigma\)is defined by declaring a string \(x = x_{1}x_{2}x_{3}\ldots x_{k}\)smaller than a string \(y = y_{1}y_{2}y_{3}\ldots y_{l}\)if either there exists a j ≥ 1 such that \(x_{i} = y_{i}\)for 1 ≤ i < j and \(x_{j} <y_{j}\)or if k < l and \(x_{i} = y_{i}\)for 1 ≤ i ≤ k. Given a set S of strings over some ordered alphabet, the problem is to sort S according to lexicographical order.

The input to the string sorting problem consists of an array of pointers to the strings to be sorted. The output is a...

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 1,599.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD 1,999.99
Price excludes VAT (USA)
  • Durable hardcover 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

Recommended Reading

  1. Aggarwal A, Vitter JS (1988) The input/output complexity of sorting and related problems. Commun ACM 31:1116–1127

    Article  MathSciNet  Google Scholar 

  2. Andersson A, Nilsson S (1994) A new efficient radix sort. In: Proceedings of the 35th annual symposium on foundations of computer science (FOCS’94), Santa Fe. IEEE Computer Society Press, pp 714–721

    Chapter  Google Scholar 

  3. Andersson A, Nilsson S (1998) Implementing radixsort. ACM J Exp Algorithmics 3:7

    Article  MathSciNet  MATH  Google Scholar 

  4. Arge L, Ferragina P, Grossi R, Vitter JS (1997) On sorting strings in external memory (extended abstract). In: Proceedings of the 29th annual ACM symposium on theory of computing (STOC’97), El Paso. ACM, pp 540–548

    Google Scholar 

  5. Bentley J, Sedgewick R (1998) Algorithm alley: sorting strings with three-way radix quicksort. Dr Dobb’s J Softw Tools 23:133–134, 136–138

    Google Scholar 

  6. Bentley JL, McIlroy MD (1993) Engineering a sort function. Softw Pract Exp 23:1249–1265

    Article  Google Scholar 

  7. Fagerberg R, Pagh A, Pagh R (2006) External string sorting: faster and cache-oblivious. In: Proceedings of the 23rd annual symposium on theoretical aspects of computer science (STACS’06), Marseille. LNCS, vol 3884. Springer, pp 68–79

    Google Scholar 

  8. Franceschini G, Grossi R (2004) A general technique for managing strings in comparison-driven data structures. In: Proceedings of the 31st international colloquium on automata, languages and programming (ICALP’04), Turku. LNCS, vol 3142. Springer, pp 606–617

    Google Scholar 

  9. Franceschini G, Grossi R (2005) Optimal in-place sorting of vectors and records. In: Proceedings of the 32nd international colloquium on automata, languages and programming (ICALP’05), Lisbon. LNCS, vol 3580. Springer, pp 90–102

    Google Scholar 

  10. Grossi R, Italiano GF (1999) Efficient techniques for maintaining multidimensional keys in linked data structures. In: Proceedings of the 26th international colloquium on automata, languages and programming (ICALP’99), Prague. LNCS, vol 1644. Springer, pp 372–381

    Google Scholar 

  11. Han Y, Thorup M (2002) Integer sorting in \(O(n\sqrt{\log \log n})\)expected time and linear space. In: Proceedings of the 43rd annual symposium on foundations of computer science (FOCS’02), Vancouver. IEEE Computer Society Press, pp 135–144

    Google Scholar 

  12. McIlroy PM, Bostic K, McIlroy MD (1993) Engineering radix sort. Comput Syst 6:5–27

    Google Scholar 

  13. Mehlhorn K (1979) Dynamic binary search. SIAM J Comput 8:175–198

    Article  MathSciNet  MATH  Google Scholar 

  14. Sedgewick, R (2003) Algorithms in Java, Parts 1–4, 3rd edn. Addison-Wesley, Boston

    Google Scholar 

  15. Sedgewick R, Bentley J (1997) Fast algorithms for sorting and searching strings. In: Proceedings of the 8th annual ACM-SIAM symposium on discrete algorithms (SODA’97), New Orleans. ACM, pp 360–369

    Google Scholar 

  16. Sinha R, Zobel J, Ring D (2006) Cache-efficient string sorting using copying. ACM J Exp Algorithmics 11: Article No. 1.2

    Google Scholar 

Download references

Acknowledgements

Research supported by Danish Council for Independent Research, Natural Sciences.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rolf Fagerberg .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer Science+Business Media New York

About this entry

Cite this entry

Fagerberg, R. (2016). String Sorting. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, New York, NY. https://doi.org/10.1007/978-1-4939-2864-4_408

Download citation

Publish with us

Policies and ethics