__author__ = 'student''''quicksortstep 1, choose one pivot, such as pivot=la[0]step 2, scan the data from right side, find data less than pivot, then swap this with pivotpivot=1 [4] 5 7 3 20 9 [j]then scan from left side, find data greater than pivot, then swap the position j and i4 [] 7 3 20 9 5when i>=j then finish one loop. then put the pivot in the i; all data are dived by pivot now. left is less than pivot and right are greater than pivot.think step by step then do it and try somethingstep 3. then you have two parts to sort, left part and right part.recursive call this method to sort'''import randomdef quicksort(la,l,r): if l>=r : return left=l;right=r pivot=la[left] while left < right: while leftpivot: right-=1 if left =la[0]])import syssys.setrecursionlimit(999)la=[]def generatenumbers(la,len): for x in range(len): la.extend([random.randint(1,50)])generatenumbers(la,1000)print laquicksort(la,0,len(la)-1)print la