Skip to main content

String Sorting

1997; Bentley, Sedgewick

  • Reference work entry
Encyclopedia of Algorithms
  • 413 Accesses

Keywords and Synonyms

Sorting of multi-dimensional keys; Vector sorting    

Problem Definition

The problem is to sort a set of strings into lexicographical order. More formally: A string over an alphabet Î£ is a finite sequence \( { x_1 x_2 x_3 \dots x_k } \) where \( { x_i \in \Sigma } \) for \( { i = 1,\dots,k } \). The x i 's are called the characters of the string, and k is the length of the string. If the alphabet Î£ is ordered, the lexicographical order on the set of strings over Σ is defined by declaring a string \( { x = x_1 x_2 x_3 \dots x_k } \) smaller than a string \( { y = y_1 y_2 y_3 \dots y_l } \) if either there exists a \( { j \ge 1 } \) such that \( { x_i = y_i } \) for \( { 1 \le i < j } \) and \( { x_j < y_j } \), or if \( { k < l } \) and \( { x_i = y_i } \) for \( { 1 \le i \le 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...

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 399.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Ferragina, personal communication.

Recommended Reading

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

    Article  MathSciNet  Google Scholar 

  2. Andersson, A., Nilsson, S.: A new efficient radix sort. In: Proceedings of the 35th Annual Symposium on Foundations of Computer Science (FOCS '94), IEEE Comput. Soc. Press, pp. 714–721 (1994)

    Google Scholar 

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

    Google Scholar 

  4. Arge, L., Ferragina, P., Grossi, R., Vitter, J.S.: On sorting strings in external memory (extended abstract). In: Proceedings of the 29th Annual ACM Symposium on Theory of Computing (STOC '97), ACM, ed., pp. 540–548. ACM Press, El Paso (1997),

    Chapter  Google Scholar 

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

    Google Scholar 

  6. Bentley, J.L., McIlroy, M.D.: Engineering a sort function. Softw. Pract. Exp. 23, 1249–1265 (1993)

    Article  Google Scholar 

  7. Fagerberg, R., Pagh, A., Pagh, R.: External string sorting: Faster and cache-oblivious. In: Proceedings of STACS '06. LNCS, vol. 3884, pp. 68–79. Springer, Marseille (2006)

    Google Scholar 

  8. Franceschini, G., Grossi, R.: 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). LNCS, vol. 3142, pp. 606–617. Springer, Turku (2004)

    Google Scholar 

  9. Franceschini, G., Grossi, R.: Optimal in-place sorting of vectors and records. In: Proceedings of the 32nd International Colloquium on Automata, Languages and Programming (ICALP '05). LNCS, vol. 3580, pp. 90–102. Springer, Lisbon (2005)

    Google Scholar 

  10. Grossi, R., Italiano, G.F.: Efficient techniques for maintaining multidimensional keys in linked data structures. In: Proceedings of the 26th International Colloquium on Automata, Languages and Programming (ICALP '99). LNCS, vol. 1644, pp. 372–381. Springer, Prague (1999)

    Google Scholar 

  11. Han, Y., Thorup, M.: 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), pp. 135–144. IEEE Computer Society Press, Vancouver (2002)

    Google Scholar 

  12. McIlroy, P.M., Bostic, K., McIlroy, M.D.: Engineering radix sort. Comput. Syst. 6, 5–27 (1993)

    Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

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

    Google Scholar 

  15. Sedgewick, R., Bentley, J.: Fast algorithms for sorting and searching strings. In: Proceedings of the 8th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA '97), ACM, ed., pp. 360–369. ACM Press, New Orleans (1997)

    Google Scholar 

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

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag

About this entry

Cite this entry

Fagerberg, R. (2008). String Sorting. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-30162-4_408

Download citation

Publish with us

Policies and ethics