def mppx(li, l=2):
if l > len(li):
return 1
mppx(li, l + 1)
for i in range(l - 1):
if li[i] > li[i + 1]:
li[i], li[i + 1] = li[i + 1], li[i]
lis = [7, 2, 9, 6, 55, 67, 22, 31, 97, 33, 0]
mppx(lis)
print(lis)
python递归冒泡排序
于 2023-08-02 11:27:52 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)