Learning Outcomes
At the end of this lecture, you’ll be able to:
- Explain and trace the operations of MergeSort on a particular data sequence.
- Implement MergeSort efficiently (allowing $O(n)$ auxiliary space).
- Analyze the best- and worst-case space and time efficiency of merge phase and MergeSort overall.
- Determine how to optimize the merge phase to be $O(1)$ for sorted subarrays, and why this results in $O(n)$ for already sorted starting sequences.
Lecture Plan
In this lecture, we'll cover the following lessons:
- Review: The sorting algorithms we already know!
- Merge Sort: The Big Picture!
- Merge Sort: Recursive Implementation⚡
- Merge Sort: The Merge Process⚡
- Merge Sort: Implement Merge⚡
- Merge Sort: Analysis⚡
- Merge Sort: Optimization?⚡
Lessons marked with ⚡ contain exercise/activity.