01 2021 档案

摘要:堆排序 def sift(li, low, high): """ :param li: :param low: 堆顶位置索引 :param high: 最后一个元素索引 :return: """ i = low j = 2 * i + 1 tmp = li[i] while j <= high: i 阅读全文
posted @ 2021-01-26 23:59 guoguo514 阅读(83) 评论(0) 推荐(0)
摘要:汉诺塔 def hanoi(n, a, b, c): if n > 0: hanoi(n - 1, a, c, b) print(a + " >" + c) hanoi(n - 1, b, a, c) 二分法 二分法递归 def binary_s(li, item, start=0, end=Non 阅读全文
posted @ 2021-01-19 21:49 guoguo514 阅读(77) 评论(0) 推荐(0)
摘要:1.冒泡排序 https://www.cnblogs.com/bigdata-stone/p/10464243.html '''冒泡排序''' # coding:utf-8 lis = [1, 13, 5, 35, 6, 9, 10] s = range(len(lis))[::-1] print( 阅读全文
posted @ 2021-01-17 19:49 guoguo514 阅读(79) 评论(0) 推荐(0)