Why is sorting part of merge sort 0(n/2) and not 0(n)?

I understand the process of a merge sort, but I'm having a hard time understanding how it's any better than a basic insertion sort. Seemingly, the big savings is splitting arr[n] into L[n/2] and R[n/2] but how is traversal/sorting L and R separately any different from traversal and sorting original arr[n]?

And then, when you'd be done with the traversal in arr[n], you still have to perform the merge operation of L[n/2] and R[n/2]

Now, I could see an advantage in a multi threaded situation where you spin up threads for each subset of the array, but in a single-threaded routine, I'm having a hard time leveling it.

Comments (0)