voidbubblesort1(int R[],int n){int lo=0,last=n,t=0;while(last>0){for(int i =0; i < n-1; i++){if(R[i]> R[i +1]){swap(R[i], R[i +1]);
t++;
last = i;}}if(t !=0){
n = last+1;
t =0;}else{
last =0;}}}
数据结构跳跃式起泡算法如下:n为数组规模,代码可以灵活更改void bubblesort1(int R[], int n){ int lo=0,last=n,t=0; while (last>0) { for (int i = 0; i < n-1; i++) { if (R[i] > R[i + 1]) { swap(R[i], R[i + 1]); t++;