Two classical sorting algorithms: mergesort, quicksort.
1. Mergesort
Divide and conquer: top 10 algorithms of the 20th century, invented by von Neumann.
Idea:
- divide array into 2 halves
- recursively sort each half
- merge two sorted halves
Implementation
Merge:
Goal: a[lo] to a[mid] and a[mid+1] to a …


