冒泡排序(参考Discrete Mathematics and Its Application一书中的伪码),,[Python]代码to
冒泡排序(参考Discrete Mathematics and Its Application一书中的伪码),,[Python]代码to
[Python]代码
tosort = [2, 3, 4, 1, 9, 10, 8, 7, 19, 7]for i in range(len(tosort)): for j in range(len(tosort)-i-1): if tosort[j]>tosort[j+1]: tosort[j+1], tosort[j] = tosort[j], tosort[j+1]print tosort
[Python]代码
for i in range(len(tosort)): for j in range(1, len(tosort)-i): if tosort[j-1]>tosort[j]: tosort[j-1], tosort[j] = tosort[j], tosort[j-1]print tosort
相关内容
- 上传文件,,[Python]代码<!
- python telnet登陆RouterOS执行相关命令,并返回命令执行结
- 利用bs4获取58同城城市分类,bs4获取58同城,python beaut
- Python 处理图像几何变换,python图像几何变换,[Python]代码
- python urllib2和httplib请求的速度比较实例测试,urllib2ht
- 使用python下载网页上的flash,pythonflash,[Python]代码''
- Python 批量获取《oschina》高亮代码区域源码!,python《
- Find bridges of graph,bridgesgraph,[Python]代码#
- 用Python实现一个简单的算术游戏,python实现算术,#!/us
- 绑定修改网卡绑定关系脚本,修改网卡绑定脚本,[Pyth
评论关闭