Overview
This week we continue our tour of sorting algorithms. We introduce two new \mathcal{O}(n^2) algorithms—selection and insertion sort, and we introduce our first $(n n) sorting algorithm—merge sort. Merge sort represents a different class of algorithms, called “divide and conquer” algorithms. These algorithms solve problems by breaking a problem down into smaller problem instances, solving the smaller problems, and then—by various means—combining the results of smaller problems to produce a complete solution. These algorithms work by recursion.
While we introduce the divide and conquer approach in the context of sorting, you should be aware that it is a technique with applicability to numerous problems in a wide variety of domains.
Learning Objectives
By the end of this module, you will be able to:
- Understand and implement selection sort, insertion sort, and merge sort algorithms.
- Understand the use cases and limitations for each of these sorting algorithms.
- Understand the complexity of each of these sorting algorithms.
To achieve this module’s objectives, please watch the introductory video (above), and complete the following:
Read: Essential Algorithms, O(N log N) Algorithms: pp. 138-155 (Chapter 6). OPTIONAL: Chapter 9: pp. 185-193, for more on recursion.
Read / view the following content and complete any comprehension checks:
- Selection sort
- Insertion sort
- Merge sort
Copyright © 2023–2025 Clayton Cafiero
No generative AI was used in producing this material. This was written the old-fashioned way.