, Volume 69, Issue 4, pp 958–973 | Cite as

Multikey Quickselect

  • Leonor Frias
  • Salvador Roura


We present multikey quickselect: an efficient, in-place, easy-to-implement algorithm for the selection problem for strings. We analyze its expected cost under a uniform model, measured as the number of character comparisons and pointer swaps, depending on the alphabet cardinality. From the analysis, we derive a binary variant of the algorithm, which is more efficient when the range of values for the alphabet is known. This variant can also be applied to multikey quicksort.


Selection Strings Analysis of algorithms Average-case Partition Divide-and-conquer 


  1. 1.
    Bentley, J.L., McIlroy, M.D.: Engineering a sort function. Softw. Pract. Exp. 23(11), 1249–1265 (1993) CrossRefGoogle Scholar
  2. 2.
    Bentley, J.L., Sedgewick, R.: Fast algorithms for sorting and searching strings. In: SODA’97: Proceedings of the Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 360–369. Society for Industrial and Applied Mathematics, Philadelphia (1997) Google Scholar
  3. 3.
    Clément, J., Flajolet, P., Vallée, B.: Dynamical sources in information theory: a general analysis of trie structures. Algorithmica 29(1), 307–369 (2001) CrossRefzbMATHMathSciNetGoogle Scholar
  4. 4.
    Franceschini, G., Grossi, R.: A general technique for managing strings in comparison-driven data structures. In: Díaz, J., Karhumäki, J., Lepistö, A., Sannella, D. (eds.) ICALP’04: Proceedings of the 31st International Colloquium on Automata, Languages and Programming. Lecture Notes in Computer Science, vol. 3142, pp. 606–617. Springer, Berlin/Heidelberg (2004) CrossRefGoogle Scholar
  5. 5.
    Frias, L.: On the number of string lookups in BSTs (and related algorithms) with digital access. Technical report LSI-09-14-R, Universitat Politècnica de Catalunya, Departament de Llenguatges i Sistemes Informàtics (2009).
  6. 6.
    Grossi, R., Italiano, G.F.: Efficient techniques for maintaining multidimensional keys in linked data structures. In: Wiedermann, J., van Emde Boas, P., Nielsen, M. (eds.) Automata, Languages and Programming, 26th International Colloquium, ICALP’99, Prague, Czech Republic, July 11–15, 1999. Lecture Notes in Computer Science, vol. 1644, pp. 372–381. Springer, Berlin/Heidelberg (1999) CrossRefGoogle Scholar
  7. 7.
    Hildebrandt, P., Isbitz, H.: Radix exchange—an internal sorting method for digital computers. J. ACM 6(2), 156–163 (1959) zbMATHMathSciNetGoogle Scholar
  8. 8.
    International Standard ISO/IEC 14882: Programming Languages—C++, 3rd edn. (2011). American National Standard Institute Google Scholar
  9. 9.
    Kärkkäinen, J., Rantala, T.: Engineering radix sort for strings. In: Amir, A., Turpin, A., Moffat, A. (eds.) String Processing and Information Retrieval, 15th International Symposium, SPIRE 2008, Melbourne, Australia, November 10–12, 2008. Lecture Notes in Computer Science, vol. 5280, pp. 3–14. Springer, Berlin/Heidelberg (2008) CrossRefGoogle Scholar
  10. 10.
    Kim, E., Park, K.: Improving multikey quicksort for sorting strings with many equal elements. Inf. Process. Lett. 109(9), 454–459 (2009) CrossRefzbMATHGoogle Scholar
  11. 11.
    Mahmoud, H., Flajolet, P., Jacquet, P., Régnier, M.: Analytic variations on bucket selection and sorting. Acta Inform. 36(9–10), 735–760 (2000) CrossRefzbMATHMathSciNetGoogle Scholar
  12. 12.
    Mahmoud, H.M., Modarres, R., Smythe, R.T.: Analysis of quickselect: an algorithm for order statistics. RAIRO Theor. Inform. Appl. 29(4), 255–276 (1995) zbMATHMathSciNetGoogle Scholar
  13. 13.
    Martínez, C., Roura, S.: Optimal sampling strategies in quicksort and quickselect. SIAM J. Comput. 31(3), 683–705 (2001) CrossRefzbMATHMathSciNetGoogle Scholar
  14. 14.
    Mcilroy, P.M., Bostic, K., Mcilroy, M.D.: Engineering radix sort. Comput. Syst. 6, 5–27 (1993) Google Scholar
  15. 15.
    Roura, S.: Digital access to comparison-based tree data structures and algorithms. J. Algorithms 40(1), 1–23 (2001) CrossRefzbMATHMathSciNetGoogle Scholar
  16. 16.
    Roura, S.: Improved master theorems for divide-and-conquer recurrences. J. ACM 48(2), 170–205 (2001) CrossRefzbMATHMathSciNetGoogle Scholar
  17. 17.
    Sinha, R., Wirth, A.: Engineering burstsort: towards fast in-place string sorting. In: McGeoch, C.C. (ed.) Experimental Algorithms, 7th International Workshop, WEA 2008, Provincetown, MA, USA, May 30–June 1, 2008. Lecture Notes in Computer Science, vol. 5038, pp. 14–27. Springer, Berlin/Heidelberg (2008) CrossRefGoogle Scholar
  18. 18.
    Vallée, B., Clément, J., Fill, J.A., Flajolet, P.: The number of symbol comparisons in quicksort and quickselect. In: 36th International Colloquium on Automata, Languages and Programming (ICALP 2009). Lecture Notes in Computer Science, vol. 5555, pp. 750–763. Springer, Berlin/Heidelberg (2009) CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2013

Authors and Affiliations

  1. 1.Departament de LSIUniversitat Politècnica de CatalunyaBarcelonaSpain

Personalised recommendations