Skip to content
Snippets Groups Projects
Commit adc45061 authored by Lawrence Chung's avatar Lawrence Chung
Browse files

Flawed mergeSort

parent 3093f590
No related branches found
No related tags found
No related merge requests found
package sort;
public class mergeSort {
public class mergeSort implements GeneralCompare{
private static GeneralCompare[] aux;
......@@ -18,8 +18,16 @@ public class mergeSort {
aux[i] = gc[i];
}
for(int i = 1; i <= n; i++){
if(i > mid)
gc[i] = aux[mid+2];
else if(mid+1 > n)
gc[i] = aux[2];
else if(compare(aux[mid+1],aux[1]) < 0)
gc[i] = aux[i];
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment