October 2025
Intermediate to advanced
485 pages
13h 2m
English
Let’s figure out the efficiency of Mergesort. To help with this, we’ll first look at Mergesort from a bird’s-eye view, as this will put everything in perspective.
Here’s a visual that shows the entire Mergesort process in one fell swoop. I removed all of the array data since it’s not relevant to our analysis.

Looking at the diagram, notice that the original array is repeatedly broken down into halves until we’re eventually left with single-element arrays. Note that there are 3 “levels”; that is, for this array of size 8, it takes 3 halvings until we break up the array into single-element subarrays.
In more general ...
Read now
Unlock full access