Recursion -- Continued
We’ll look at Merge Sort as an example of recursion and a faster way to sort long lists.
The previous sorts we considered took time proportional to N^2 to sort N items. Merge Sort takes time proportional to N log (N). (All logs in these slides are to the base 2.)
For example, if you have N = 10^6 items to sort and you can do about 10^6 comparisons a second, then the slower N^2 sorts will take about 10^6 seconds, which is about 11 days. Merge sort will take about 20 seconds.