QuickSort is also a Sort Algorithm for input arrays containing n arrays. The worst run time is O (n ^ 2 ). Although the Run Time in the worst case is relatively poor, fast sorting is usually the best practical choice for sorting, because its average performance is quite good and the expected run time is O (nlgn ), in addition, the constant factor hidden in O (nlgn) is very small, and it can also perform local sorting in a virtual environment. I. Fast sorting principle the same is true for fast sorting and Merge Sorting. Based on the division and control method, there are three steps: decomposition, solution, and merge. decomposition: array [low... high] is divided into two (possibly empty) Sub-array [low... temp-1] and array [temp + 1... high] to make array [low... every element in temp-1] is less than or equal to array [temp], while array [temp + 1... every element in high] is greater than array [temp], and the subscript temp is also calculated in this process. Solution: Use recursive call to quickly sort the sub-array [low... temp-1], array [temp + 1... high] sorting; merge: because the two sub-arrays are sorted in place, merging them does not require any operation. The entire array [low... high] is sorted. II. Implementation of quick sorting [cpp] # include <iostream> # include <ctime> # include <cstdlib> # define N 10 using namespace std; // The recursive algorithm void quickSort (int * array, int low, int high) for fast sorting; // calculate the split point int partition (int * array, int low, int high ); // exchange the values of two variables void exchange (int & a, int & B); int main () {// declare an array to be sorted int array [N]; // set the Randomization seed to avoid generating the same random number srand (time (0) each time; for (int I = 0; I <N; I ++) {array [I] = rand () % 101; // use the random function to assign values to arrays. Number Generation random number between 1-} cout <"Before sorting:" <endl; for (int j = 0; j <N; j ++) {cout <array [j] <";}cout <endl <" after sorting: "<endl; // call the quick sort function to sort the array quickSort (array, 0, N-1); for (int k = 0; k <N; k ++) {cout <array [k] <";}cout <endl; return 0 ;}// main void quickSort (int * array, int low, int high) {if (low