コード例 #1
0
def permutate(list):
	n = len(list)
	for i in xrange(n):
		rnd = randint(0, n-i-1)
		swap(list, rnd, i)
コード例 #2
0
ファイル: bozoSort.py プロジェクト: ABuffEr/sortingAlgorithms
def sort(list):
    while not isSorted(list):
        i1, i2 = randomIndexes(len(list) - 1)
        swap(list, i1, i2)
    return list