11
Sorting
Sorting means reorganizing data in such a way that it is in ascending or descending order. Sorting is one of the most important algorithms in computer science and is widely used in database-related algorithms. For several applications, if the data is sorted, it can efficiently be retrieved, for example, if it is a collection of names, telephone numbers, or items on a simple to-do list.
In this chapter, we’ll study some of the most important and popular sorting techniques, including the following:
- Bubble sort
- Insertion sort
- Selection sort
- Quicksort
- Timsort
Technical requirements
All source code used to explain the concepts of this chapter is provided in the GitHub repository at the following link:
Get Hands-On Data Structures and Algorithms with Python - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.