The basic concept of BubbleSort is to compare two adjacent numbers in sequence, put decimal places in front, and put large numbers in the back. That is, in the first step: first compare the number of 1st and the number of 2nd, and put the decimal number before and after the large number. Then compare the numbers of 2nd and 3rd, place the decimal places before and after the large number, and continue until the last two digits are compared. Place the decimal places before and after the large number. So far, the first stop is over, and the maximum number is placed at the end. In the second round: The comparison starts from the first logarithm (because the number of 2nd is exchanged with the number of 3rd, the number of 1st is no less than 2nd). Before and after placing the decimal number, always compare to the second to the last (the largest position in the last), and the second stop, get a new maximum number at the penultimate position (in fact, it is the second largest number in the entire series ). In this case, repeat the above process until the sorting is completed. The c code implementation is as follows: [cpp] # include <stdio. h> // print the array void display (int array [], int size) {printf ("the array is:"); int I; for (I = 0; I <size; I ++) {printf ("% d", array [I]);} printf ("\ n ");} // Bubble Sorting Algorithm void sort (int array [], int size) {int I, j, temp, flag; for (I = 0; I <size; I ++) {flag = 0; for (j = size-1; j> I; j --) {// if the previous number is greater than the next one, then swap if (array [J-1]> array [j]) {temp = array [j]; array [j] = array [J-1]; array [J-1] = temp; flag = 1 ;}} // If This sorting is not exchanged once, break reduces the number of executions. If (flag = 0) {break;} display (array, size) ;}int main (void) {int array [10] =, 65,100,}; display (array, 10); sort (array, 10); return 0 ;}