RIOChing

关注

bx05_insert_sort

RIOChing

关注

阅读 110

2022-02-10

def insert_sort(li):

    # i: 摸到的牌的 index
    for i in range(1, len(li)):
        # 记录下这张牌,防止被覆盖掉
        temp = li[i]
        # j: 手里最右边牌的 index
        j = i - 1

        while j >= 0 and li[j] > temp:
            li[j + 1] = li[j]
            j -= 1
        li[j + 1] = temp

相关推荐

青乌

bx04_select_sort

青乌 115 0 0

是她丫

bx03_bubble_sort

是她丫 94 0 0

代码敲到深夜

2019-05-01-js-sort

代码敲到深夜 82 0 0

一点读书

插入排序 insert_sort1 与 insert_sort_while的区别 细节排查自己的习惯错在哪儿?

一点读书 174 0 0

陆公子521

bx01_hanoi_recursion

陆公子521 80 0 0

zmhc

insert into,insert into select,re

zmhc 145 0 0

老榆

bx02_linear&binary_search

老榆 129 0 0

yeamy

sort

yeamy 109 0 0

搬砖的小木匠

INSERT IGNORE 与INSERT INTO与 REPLACE INTO

搬砖的小木匠 151 0 0

_刘彦辉

仰邦BX.K协议对接

_刘彦辉 22 0 0

精彩评论(0)

0 0 举报