Skip to main content

Sorting

  • Chapter
  • First Online:
  • 3869 Accesses

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

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alexander Shen .

Rights and permissions

Reprints 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

Publish with us

Policies and ethics