Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud
by Paul J. Deitel, Harvey M. Deitel
11.10 Sorting Algorithms
Sorting data (i.e., placing the data in a particular order, such as ascending or descending) is one of the most important computing applications. Virtually every organization must sort some data, and often massive amounts of it. Sorting data is an intriguing, computer-intensive problem that has attracted intense research efforts.
An important item to understand about sorting is that the end result—the sorted array—will be the same no matter which algorithm you use to sort the array. The choice of algorithm affects only the run time and memory use of the program. The rest of this chapter introduces three common sorting algorithms. The first two—selection sort and insertion sort—are relatively simple to program but inefficient ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access