MCPcopy Create free account
hub / github.com/DasyDong/developer-roadmap / bubble_sort

Function bubble_sort

code/all_sort.py:72–77  ·  view source on GitHub ↗
(arr1)

Source from the content-addressed store, hash-verified

70
71# 冒泡
72def bubble_sort(arr1):
73 for i in range(len(arr1)):
74 for j in range(len(arr1[1:])):
75 if arr1[i] < arr1[j]:
76 arr1[i], arr1[j] = arr1[j], arr1[i]
77 return arr1
78
79print(merge_sort([1,7,6, 8,22,6,77,11, 66, 14]))
80

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected