diff --git a/bubble_sort.py b/bubble_sort.py index db7db5f..b60c1e3 100644 --- a/bubble_sort.py +++ b/bubble_sort.py @@ -6,3 +6,18 @@ def sorter(arr): arr[j] = arr[j + 1] arr[j + 1] = temp return arr + + +def sorter3(arr): + arr.sort() + return arr + + +def sorter4(arr): + for i in range(len(arr)): + for j in range(len(arr) - 1): + if arr[j] > arr[j + 1]: + temp = arr[j] + arr[j] = arr[j + 1] + arr[j + 1] = temp + return arr