借鉴快速排序的思想
快速排序代码
def quicksort(nums):
l = 0
r = len(nums)-1
_quicksort(nums, l, r)
def...= [6,2,4,1,2,3,5,2,7]
quicksort(nums)
print(nums)
借鉴快速排序思想
def findKthLargest(numbers, start, end, k)...:
if k = len(numbers) or k > end:
return None
low =...return partitionOfK(numbers, low+ 1, end, k)
elif low > k:
return partitionOfK(numbers, start..., low- 1, k)
else:
return numbers[low]
numbers = [3,5,6,7,2,-1,9,3]
print(sorted(numbers))
print