# -*- coding:utf-8 -*-classSolution:defGetLeastNumbers_Solution(self, tinput, k):# write code hereif k >len(tinput):return[]
self.quick_sort(tinput,0,len(tinput)-1)return tinput[:k]defquick_sort(self,li,first,last):if first >= last:return
mid_value = li[first]
low = first
high = last
while low < high:while low < high and li[high]>= mid_value:
high -=1
li[low]= li[high]while low < high and li[low]< mid_value:
low +=1
li[high]= li[low]
li[low]= mid_value
self.quick_sort(li,first,low-1)
self.quick_sort(li,low+1,last)
旋转数组的最小数字# -*- coding:utf-8 -*-class Solution: def minNumberInRotateArray(self, rotateArray): # write code here if not rotateArray: return None if len(rotate...