Comments on: Merge Sort – Algorithm, Source Code, Time Complexity https://www.happycoders.eu/algorithms/merge-sort/ Fri, 02 May 2025 08:15:38 +0000 hourly 1 By: Dr Yazdani Hasan https://www.happycoders.eu/algorithms/merge-sort/#comment-16968 Sat, 09 Oct 2021 11:13:23 +0000 https://www.happycoders.eu/?p=15309#comment-16968 excellent explanation

]]>
By: Diego S https://www.happycoders.eu/algorithms/merge-sort/#comment-16454 Thu, 22 Apr 2021 22:05:12 +0000 https://www.happycoders.eu/?p=15309#comment-16454 Hello,

By any chance, do you happen to have natural merge in Python?

]]>
By: Sven Woltmann https://www.happycoders.eu/algorithms/merge-sort/#comment-3709 Wed, 09 Dec 2020 19:22:43 +0000 https://www.happycoders.eu/?p=15309#comment-3709 In reply to Sven Woltmann.

I had to replace "undefined" by a forward slash in the WordPress backend, then it worked. When I enter a forward slash in the comment field, it also comes out as "undefined". Very strange.

]]>
By: Sven Woltmann https://www.happycoders.eu/algorithms/merge-sort/#comment-3708 Wed, 09 Dec 2020 19:20:12 +0000 https://www.happycoders.eu/?p=15309#comment-3708 In reply to Sven Woltmann.

Ok, now I now why you always wrote "undefined". It happens to mee, too ;-)

]]>
By: Sven Woltmann https://www.happycoders.eu/algorithms/merge-sort/#comment-3707 Wed, 09 Dec 2020 19:19:32 +0000 https://www.happycoders.eu/?p=15309#comment-3707 In reply to Arif Wiranata.

Hi Arif,

thanks for your comment. Do you refer to

n*1, n/2 * 2, n/4 * 4, etc... ?

Imagine you have 16 elements.
In the first step, you have to merge 16 times 1 element = 16 steps
In the second step. you now have 8 blocks of 2 elements to merge, 8 * 2 = 16 / 2 * 2 = 16 steps
In the third step, you then have 4 blocks of 4 elements, 4 * 4 = 16 / 4 * 4 = 16 steps
In the fifth step, you have 2 blocks of 8 elements, 2 * 8 = 16 / 8 * 8 = 16 steps

If you replace 16 by n, you get n*1, n/2*2, n/4*4, n/8*8, or just always n.

]]>
By: Arif Wiranata https://www.happycoders.eu/algorithms/merge-sort/#comment-3691 Wed, 09 Dec 2020 15:49:35 +0000 https://www.happycoders.eu/?p=15309#comment-3691 hello sir, i still can't understand how to get that "n undefined 2 × 2, etc" on time complexity..

]]>