Skip to content
Snippets Groups Projects
Commit 95e4ad5f authored by Miguel Espino's avatar Miguel Espino
Browse files

fixed qsort not sorting the last element

parent a497fea3
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ void myQsort(void *v[], int left, int right, Comparator comp)
(*swap)(v, left, (left + right)/2);
last = left;
for (index = left+1; index < right; index++)
for (index = left+1; index <= right; index++)
{
if ((*comp)(v[index],v[left]) < 0)
(*swap)(v, ++last, index);
......
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