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

Questions about conditional and incorrect statements

parent 27ebc8e1
No related branches found
No related tags found
No related merge requests found
......@@ -19,12 +19,14 @@ public class mergeSort implements GeneralCompare{
}
for(int i = 1; i <= n; i++){
if(i > mid)
gc[i] = aux[mid+2];
else if(mid+1 > n)
if(i > mid) //Should these not be a[i] and a[mid]?
gc[i] = aux[mid++];
else if(mid+1 > n) //^
gc[i] = aux[2];
else if(compare(aux[mid+1],aux[1]) < 0)
else if(compare(aux[mid+1],aux[1]) < 0)// ?
gc[i] = aux[i]; //fill statement (incorrect)
else
gc[i] = aux[2];
}
}
......
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