I made a code using VS Express 2015 to print out 5 names in C coding, but now I need to incorporate quicksort into my code to sort these names in a specific order. Here\'s the code i made, can someone modify it so it uses the quicksort algorithm?
#include
#include void quickSortMain(char items[][5], int count); void quickSort(char items[][5], int left, int right); int main(void) { int i; char str[][5] = { firstname,firstname1,firstname2,firstname3,firstname4 }; quickSortMain(str, 5); for(i=0; i<5; i++) { printf(\"%s \", str[i]); } return 0; } void quickSortMain(char items[][5], int count) { quickSort(items, 0, count-1); } void quickSort(char items[][5], int left, int right) { int i, j; char *x; char temp[5]; i = left; j = right; x = items[(left+right)/2]; do { while((strcmp(items[i],x) < 0) && (i < right)) { i++; } while((strcmp(items[j],x) > 0) && (j > left)) { j--; } if(i <= j) { strcpy(temp, items[i]); strcpy(items[i], items[j]); strcpy(items[j], temp); i++; j--; } } while(i <= j); if(left < j) { quickSort(items, left, j); } if(i < right) { quickSort(items, i, right); } }