Note
James_chok
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
寻找数组中第K大的数字-快排解法(Python3)
给定一个数组A,寻找第k大的数字。 本质上是查询操作,但是却使用到快排思想(即分治) A = [-1, 3, -2, 4, -5]; def partition(A: int, low: int, high: int) -> int: temp = A[low]; while low < high: while low < high and te...原创 2019-09-26 19:42:33 · 1525 阅读 · 0 评论 -
快速排序/快排(Python3)
快排的Python3实现方法 A = [-1, 3, -2, 4, -5]; def quicksort(A: int, left: int, right: int): if left > right: return; i = left; j = right; x = A[left]; while i < j: ...原创 2019-09-27 08:44:03 · 488 阅读 · 0 评论
分享