摘要:
def partition(A, p, r): j = p+1 for i in range(p+1, r+1): if(A[i] < A[p]): tmp = A[i] A[i] = A[j] A[j] =... 阅读全文
摘要:
tmp = []def bucket_sort(old): for i in range(len(old)): tmp.append([]) for i in old: tmp[int( i * len(old) )].append(i) ... 阅读全文
摘要:
def insert_sort(old): for i in range(1, len(old)): for j in range(i, 0, -1): if(old[j] < old[j-1]): tmp = old[j] ... 阅读全文
摘要:
old = [2, 5, 3, 0, 2, 3, 0, 3]new = [0, 0, 0, 0, 0, 0]for i in range(len(old)): new[old[i]] = new[old[i]] + 1for i in range(len(new)): for j in ... 阅读全文