JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

选择排序(LOW)

发布时间 2023-08-11 20:26:16作者: zylyehuo

博客地址:https://www.cnblogs.com/zylyehuo/

# _*_coding:utf-8_*_

def select_sort(li):
    for i in range(len(li)-1): # i是第几趟
        min_loc = i
        for j in range(i+1, len(li)):
            if li[j] < li[min_loc]:
                min_loc = j
        li[i], li[min_loc] = li[min_loc], li[i]
        print(li)

li = [3,4,2,1,5,6,8,7,9]
print(li)
select_sort(li)

    本栏目推荐文章
  • The IDE is running low on memory
  • wsl 开发环境中完美解决 vm.max_map_count [65530] is too low
  • low-frequency array (LOFAR)技术分析
  • sonarqube启动报错:You must address the points described in the following [2] lines before starting Elasticsearch.bootstrap check XXXmax numberXXXfor user[sonar] is too low .XXX check the logs at XXX/.log
  • 低水平特征(low-level)高水平特征(high-level),傅里叶光谱高频低频
  • 2023ICCV_Retinexformer: One-stage Retinex-based Transformer for Low-light Image Enhancement
  • Why does Windows claim to be low on memory when I have swap space available?
  • 【流行前沿】Text + Sketch Image Compression at Ultra Low Rates
  • 插入排序(LOW)
  • 选择排序(LOW)
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们