
算法
我爱旺仔复原乳
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python插入排序拿去即可使用
def get_index(nums1): if len(nums1) == 1 or nums1[1] < nums1[0]: return 0 if nums1[-1] > nums1[-2]: return len(nums1) - 1 list = [] list.append(len(nums1) - 1) ...原创 2019-10-12 10:44:59 · 115 阅读 · 0 评论 -
Python的快速排序
#快速排序 alist要排序的元素start为起始元素 def quick_sort(alist, start, end): if start >= end: return # 设定起始元素为要寻找位置的基准元素 mid = alist[start] # low为序列左边的由左向右移动的游标 low = start # high为序列右边的由右向左移动的游标 high...原创 2019-09-28 22:45:32 · 145 阅读 · 0 评论