# -*- coding:utf-8 -*- def quicksorting(list): if list: mark=list[0] little=[m for m in list if m<mark] big=[x for x in list if x>mark] return quicksorting(little)+[mark]+quicksorting(big) else: return [] if __name__==‘__main__‘: list1=[12,4,12,5,75,23,23,67,34,23,67,23,43,1,33] print(quicksorting(list1)) # def result(list,lens): # newlist={value:key for key,value in list.items()} # nums=quicksorting(lens) # nee=[] # for i in nums: # nee+=[newlist[i]] # return nee # def zippp(list): # lens=[len(i) for i in list] # zipp=zip(list,lens) # zipped=dict(zipp) # return zipped,lens # if __name__==‘__main__‘: # fruits = [‘apple‘,‘banana‘, ‘pear‘,‘raspberry‘, ‘strawberry‘] # b,c=zippp(fruits) # print(result(b,c))
时间: 2024-11-07 17:22:23