MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / randomize

Function randomize

tools/python-3.11.9-amd64/Tools/demo/sortvisu.py:372–378  ·  view source on GitHub ↗
(array)

Source from the content-addressed store, hash-verified

370 array.reset("Distinct data, size %d" % size)
371
372def randomize(array):
373 array.reset("Randomizing")
374 n = array.getsize()
375 for i in range(n):
376 j = random.randint(0, n-1)
377 array.swap(i, j)
378 array.message("Randomized")
379
380def insertionsort(array):
381 size = array.getsize()

Callers 1

demosortFunction · 0.70

Calls 5

randintMethod · 0.80
resetMethod · 0.45
getsizeMethod · 0.45
swapMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected