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

Function bubblesort

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

Source from the content-addressed store, hash-verified

403 array.hide_partition()
404
405def bubblesort(array):
406 size = array.getsize()
407 array.reset("Bubble sort")
408 for i in range(size):
409 for j in range(1, size):
410 if array.compare(j-1, j) > 0:
411 array.swap(j-1, j)
412 array.message("Sorted")
413
414def quicksort(array):
415 size = array.getsize()

Callers

nothing calls this directly

Calls 5

getsizeMethod · 0.45
resetMethod · 0.45
compareMethod · 0.45
swapMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected