Abstract
Many efficient algorithms are based on sorting the input data, because sorting often makes solving the problem easier. This chapter discusses the theory and practice of sorting as an algorithm design tool.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The C\(++\)11 standard requires that the sort function works in \(O(n \log n)\) time; the exact implementation depends on the compiler.
- 2.
Note that in some older compilers, the function make_tuple has to be used to create a tuple instead of braces (for example, make_tuple(2,1,4) instead of {2,1,4}).
- 3.
Some people, including the author of this book, still use printed dictionaries. Another example is finding a phone number in a printed phone book, which is even more obsolete.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Laaksonen, A. (2020). Sorting and Searching. In: Guide to Competitive Programming. Undergraduate Topics in Computer Science. Springer, Cham. https://doi.org/10.1007/978-3-030-39357-1_4
Download citation
DOI: https://doi.org/10.1007/978-3-030-39357-1_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-39356-4
Online ISBN: 978-3-030-39357-1
eBook Packages: Computer ScienceComputer Science (R0)