<aside> 💡 Divide to conquer
</aside>
Fundamental for the merge sort to work.
It combines two ordered arrays into another already ordered array. It applies the parting multiple times in order to order an array.
This algorithm’s time complexity is not based on its worst-case scenario and that is because, it is always O(N log N), making sure it’s efficient in every case.
“i” controls the index of the first collection.
“j” controls the index of the second collection.
“k” controls the index of the final collection.
The length of the resulting array is going to be the sum of the length of the other two arrays.