一.冒泡排序
1.C++版
for (int i = n - 1; i > 0; i--) {
for (int j = 0; j < i; j++) {
if (v[j] > v[j + 1])
swap(v[j], v[j + 1]);
}
}
2.Python版
for i in range(n - 1, 0, -1):
for j in range(i):
if ls[j] > ls[j + 1]:
ls[j], ls[j + 1] = ls[j + 1], ls[j]
标签:int,range,未完待续,算法,ls,排序
From: https://www.cnblogs.com/Fare-well/p/16651632.html