= [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 =...numbers[low] <= key:
low += 1
numbers[high] = numbers[low]
numbers[low] = key
if low < k:...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