algorithm - Java Mergesort Implementation having a stackoverflow error -
i'm not quite sure why merge sort implementation getting stackoverflow error. i've reviewed code multiple times i'm not getting why happening. tried debugging have had trouble understanding why values 0 , 4 (the first , last index of array) never change when walk through code. , throws stack overflow error.
the first recursive call mergesort (line 17?) should use "start, mid", not "start, end". puts in endless loop, run out of stack.
trust debugger.
Comments
Post a Comment