Skip to main content

Quicksort: Combining Concurrency, Recursion, and Mutable Data Structures

  • Chapter
  • First Online:

Abstract

Quicksort (Commun. ACM 4(7):321–322, 1961) remains one of the most studied algorithms in computer science. It is important not only as a practical sorting method, but also as a splendid teaching aid for introducing recursion and systematic algorithm development. The algorithm has been studied extensively; so, it is natural to assume that everything that needs to be said about it has already been said. Yet, in attempting to code it using a recent programming language of our design, we discovered that its structure is more clearly expressed as a concurrent program that manipulates a shared mutable store, without any locking or explicit synchronization. In this paper, we describe the essential aspects of our programming language Orc (Proceedings of FMOODS/FORTE, vol. 5522 of LNCS, pp. 1–25. Springer 2009), show a number of examples that combine its features in various forms, and then develop a concise description of Quicksort. We hope to highlight the importance of including concurrency, recursion and mutability within a single theory.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   169.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

Learn about institutional subscriptions

Notes

  1. 1.

    In previous publications, F <x< G was written as F where xG.

  2. 2.

    An implementation can only approximate this guarantee.

  3. 3.

    An implementation can only approximate this guarantee.

References

  1. Armstrong, J., Virding, R., Wikström, C., Williams, M.: Concurrent Programming in ERLANG 2nd edn. Prentice Hall International (UK) Ltd., Hertfordshire, UK, (1996).

    Google Scholar 

  2. Courtois, P.J., Heymans, F., Parnas, D.L.: Concurrent control with “readers” and “writers”. Commun. ACM 14(10)667–668 (1971).

    Article  Google Scholar 

  3. Fisher, R., Yates, F.: Statistical Tables for Biological, Agricultural and Medical Research. Oliver and Boyd, London, 3rd edn. (1948).

    MATH  Google Scholar 

  4. Hewitt, C., Bishop, P., Steiger, R.: A universal modular actor formalism for artificial intelligence. International Joint Conference on Artificial Intelligence (1973).

    Google Scholar 

  5. Hoare, C.A.R.: Partition: Algorithm 63, quicksort: Algorithm 64, and find: Algorithm 65. Commun. the ACM 4(7)321–322 (1961).

    Article  Google Scholar 

  6. Hoare, C.A.R.: Communicating sequential processes. Commun. ACM 21(8)666–677 (1978).

    Article  MATH  MathSciNet  Google Scholar 

  7. Kitchin, D., Cook, W.R., Misra, J.: A language for task orchestration and its semantic properties. In: CONCUR, pp. 477–491 (2006).

    Google Scholar 

  8. Kitchin, D., Quark, A., Cook, W., Misra, J.: The Orc programming language. In Lee, D., Lopes, A., Poetzsch-Heffter, A: (eds.) Formal Techniques for Distributed Systems; Proceedings of FMOODS/FORTE, vol. 5522 of LNCS, pp. 1–25. Springer, Lisbon (2009).

    Google Scholar 

  9. Kitchin, D., Quark, A., Cook, W.R., Misra, J.: Orc user guide. http://orc.csres.utexas.edu/userguide/html/index.html.

  10. Knuth, D.E.: Seminumerical Algorithms, vol. 2 of The Art of Computer Programming, 3rd edn. Addison-Wesley, Reading, (1997).

    Google Scholar 

  11. Knuth, D.E.: Sorting and Searching, vol. 2 of The Art of Computer Programming, 2nd edn. Addison-Wesley, Reading, MA (1998).

    Google Scholar 

  12. Milner, R.: A Calculus of Communicating Systems. Springer LNCS Vol. 12, Springer-Verlag (1980).

    Book  MATH  Google Scholar 

  13. Milner, R.: Communicating and Mobile Systems: the π-Calculus. Cambridge University Press, Cambridge (May 1999).

    Google Scholar 

  14. Misra, J.: Computation orchestration: A basis for wide-area computing. In Broy, M: (ed.) Proc. of the NATO Advanced Study Institute, Engineering Theories of Software Intensive Systems, NATO ASI Series, Marktoberdorf, Germany, (2004).

    Google Scholar 

  15. Paulson, L.C.: ML for the Working Programmer. Cambridge University Press, Cambridge (1991).

    Google Scholar 

  16. Quark, A., Kitchin, D., Cook, W.R., Misra, J.: Orc language project website. http://orc.csres.utexas.edu.

  17. Sedgewick, R.: Quicksort. PhD thesis, Stanford University (1975).

    Google Scholar 

  18. Wehrman, I., Kitchin, D., Cook, W., Misra, J.: A timed semantics of Orc. Theoret. Comput. Sci. 402(2–3)234–248 (August 2008).

    MATH  MathSciNet  Google Scholar 

  19. Wehrman, I., Kitchin, D., Cook, W.R., Misra, J.: Properties of the timed operational and denotational semantics of Orc. Technical Report TR-07-65, The University of Texas at Austin, Department of Computer Sciences (December 2007).

    Google Scholar 

Download references

Acknowledgements

Jayadev Misra is deeply grateful to Tony Hoare for research ideas, inspiration,and personal friendship spanning over 3 decades. It is no exaggeration that hewould not have pursued certain research directions, that have ultimately provedquite successful, had it not been for Tony’s encouragement. This paper is a smalltoken of appreciation.

The authors are indebted to Doug McIlroy and Manuel Serrano fortheir careful reading of this manuscript and many perceptive commentsand suggestions. Our long-time collaborators, Albert Benveniste, ClaudeJard, and Jose Meseguer have helped us refine the underlying ideas ofOrc.

This work is partially supported by National Science Foundation grant CCF-0811536.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jayadev Misra .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer London

About this chapter

Cite this chapter

Kitchin, D., Quark, A., Misra, J. (2010). Quicksort: Combining Concurrency, Recursion, and Mutable Data Structures. In: Roscoe, A., Jones, C., Wood, K. (eds) Reflections on the Work of C.A.R. Hoare. Springer, London. https://doi.org/10.1007/978-1-84882-912-1_11

Download citation

  • DOI: https://doi.org/10.1007/978-1-84882-912-1_11

  • Published:

  • Publisher Name: Springer, London

  • Print ISBN: 978-1-84882-911-4

  • Online ISBN: 978-1-84882-912-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics