Abstract
Sorting is a simple and practically important example of advantages provided by efficient algorithms (over straightforward ones). First (section 4.1) we formulate the sorting problem and show two straightforward (but inefficient) algorithms. Then (section 4.2) we show two much more efficient algorithms (merge sort and heap sort) that have running times proportional to n log n (instead of n2). In section 4.3 we show how sorting algorithms can be applied even if the statement of the problem does not mention sorting. Section 4.4 provides some lower bound for the number of comparisons needed for sorting (thus showing that our algorithm cannot be significantly improved). Finally, in section 4.5 we consider some nice problems related to sorting.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2010 Springer Science+Business Media, LLC
About this chapter
Cite this chapter
Shen, A. (2010). Sorting. In: Algorithms and Programming. Springer Undergraduate Texts in Mathematics and Technology. Springer, New York, NY. https://doi.org/10.1007/978-1-4419-1748-5_4
Download citation
DOI: https://doi.org/10.1007/978-1-4419-1748-5_4
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4419-1747-8
Online ISBN: 978-1-4419-1748-5
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)