Chapter 4. Sorting Algorithms

So far we have learned about different data structures and their performance characteristics. In this chapter, we will begin learning about algorithms, which are the fundamental ways of processing data. Algorithms take a sequence of data as input, process that data, and then return a value or set of values as output.

In this chapter, we discuss sorting algorithms and how to apply them using an array data structure we learned about in the previous chapters. We will explore different algorithms that use comparison sorting and look at both simple sorting and divide and conquer strategies where the entire sorting process can be done in memory. As in Chapter 2Working with Commonly Used Data Structures, we place importance ...

Get Swift Data Structure and Algorithms 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.