diff --git a/BubbleSort.py b/BubbleSort.py index 91b2b97..2df6918 100644 --- a/BubbleSort.py +++ b/BubbleSort.py @@ -4,7 +4,7 @@ def bubble_sort(list): while is_sorted == False: swaps = 0 for i in range(len(list) - 1): - if sorted_list[i] > sorted_list[i + 1]: # swap + if sorted_list[i] < sorted_list[i + 1]: # swap temp = sorted_list[i] sorted_list[i] = sorted_list[i + 1] sorted_list[i + 1] = temp @@ -14,4 +14,5 @@ def bubble_sort(list): is_sorted = True return sorted_list -print(bubble_sort([2, 1, 3])) \ No newline at end of file +print(bubble_sort([2, 1, 3])) +