Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - It is known that the data in the sequence table L with length 6 are all integers and increase in order. Now, the integer element A is inserted into the proper position of the sequence table L, so that
It is known that the data in the sequence table L with length 6 are all integers and increase in order. Now, the integer element A is inserted into the proper position of the sequence table L, so that
Invalid? Bubble _2? (? int? r[],? int? n){?

int? Low? =? 0;

int? High =? n? - 1; ? //Set the initial value of the variable?

int? tmp,j; ?

What time? (low? & lt? High)? {?

For what? (j=? Low; ? j & lt? High; ? ++j)? //bubbling, looking for the biggest one?

What if? (r[j]& gt; ? r[j+ 1])? {?

tmp? =? r[j]; ? r[j]= r[j+ 1]; r[j+ 1]= tmp; ?

}

-high; ? //Modify the high value. Move forward one position?

For what? (? J = high; ? J> is low; ? - j)? //Reverse bubbling and find the smallest one?

What if? (r[j]& lt; r[j- 1])? {?

tmp? =? r[j]; ? r[j]= r[j- 1]; r[j- 1]= tmp; ?

}?

++low level; ? //Modify the low value and move it back one place?

}

}