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

Instruction

Alternate Versions of Merge Sort

Note: If code is not provided below in the language you are looking for, send an email to <content+cs@teamtreehouse.com>

Swift

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...