MCPcopy Create free account
hub / github.com/geekcomputers/Python / bubble_sort

Function bubble_sort

Sorting Algorithms/Bubble_sort.py:1–6  ·  view source on GitHub ↗
(Lists)

Source from the content-addressed store, hash-verified

1def bubble_sort(Lists):
2 for i in range(len(Lists)):
3 for j in range(len(Lists) - 1):
4 # We check whether the adjecent number is greater or not
5 if Lists[j] > Lists[j + 1]:
6 Lists[j], Lists[j + 1] = Lists[j + 1], Lists[j]
7
8
9# Lets the user enter values of an array and verify by himself/herself

Callers 1

Bubble_sort.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected