Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.


Alternate Versions of Merge Sort


In the previous implementation of merge sort, we carry out an array slicing operation when splitting the array in two. There is a cost to this operation that needs to be considered.

Merge sort is traditionally a O(n log n) algorithm. The split step takes logarithmic time overall with an n number of merges in total. Generally, creating an array slice in Swift does not incur a ...