Hello
Im trying to understand and explain how the quick sort code actually works, i unable to understand or xplain line 4 to 11.
Can ne of u xplain to me briefly what those lines actually do in the code algorithm....
Apreciate ne help.
do {
while(strcmp(array[i].Genre,x)<0 && i<right) i++; //line 2
while(strcmp(array[j].Genre,x)>0 && j>left) j--; //line 3
if(i<=j) { //line 4
temp = array[i]; //line 5
array[i] = array[j]; //line 6
array[j] = temp; //line 7
i++; j--; //line 8
}
}while(i<=j); //line 9
if(left<j) quick_sort(array, left, j); //line 10
if(i<right)quick_sort(array, i, right); //line 11
}