From 4a9f89870f0ca1dcf349049674f991d067800d3a Mon Sep 17 00:00:00 2001 From: "codeflash-ai[bot]" <148906541+codeflash-ai[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 23:38:42 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Speed=20up=20function=20`s?= =?UTF-8?q?orter`=20by=204211531.56=20in=20PR=20#144=20(`davidgirdwood1-pa?= =?UTF-8?q?tch-2`)=20Test=20Dave:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bubble_sort.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bubble_sort.py b/bubble_sort.py index 94d8a8c..34edcb4 100644 --- a/bubble_sort.py +++ b/bubble_sort.py @@ -9,10 +9,10 @@ def sorter(arr): def sorter2(arr): - for i in range(len(arr)): + for i in range(len(arr)-1): 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 + return arr \ No newline at end of file