Delete comment from: Java67
Hi,
I am learning java as a hobby now.
in mergesort method, this 2 while loops
while (first <= mid) { tmp[i++] = input[first++]; }
while (last <= end) { tmp[i++] = input[last++]; }
I know this two loops check the LAST element left out after the first WHILE loops. because we
always divides our array (and sub arrays) into 2 halves. Should it be 2 IF statements? I know
it doesn't make anything different but it makes a little more sense to me (in my opinion). I just
try not to use loops whenever it can be avoid. Am I missing something here?
May 19, 2021, 12:50:09 PM
Posted to How to implement Merge Sort Algorithm in Java [Solved] - Example Tutorial