Lecture Outline
- Merge Sort is a sorting algorithm that recursively divides the array into smaller sub arrays, sorting the sub arrays, and merging the sub arrays until we have the orignal array
- Merge sort runs in O(n * log n) time (much faster than selection sort and bubble sort!)
- Merge sort runs in O(n * log n) because we recursively divide the problem by 2 each time we recurse
- If you don't totally understand the merge sort code, that is fine, but you should be able to explain/draw out the steps of merge sort.
Lecture Recording
Lecture Slides
Code