From d5d46af8614cab91f929da0848d810613f873d36 Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Mon, 29 Mar 2021 16:49:37 +0100 Subject: [PATCH] Basics algs break in a more intrutive way --- basicAlgs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basicAlgs.py b/basicAlgs.py index ed8b40a..122fb32 100644 --- a/basicAlgs.py +++ b/basicAlgs.py @@ -35,14 +35,14 @@ def bubblesort(theList): # Inner Loop, for inner in range(len(theList)-1): #Get the values - leftItem = theList[inner] rightItem = theList[inner+1] + leftItem = theList[inner] #Do the Comparison if leftItem > rightItem: #Swap - theList[inner] = rightItem theList[inner] = leftItem + theList[inner] = rightItem logging.debug("Iteration {0} List is {1}".format(outer, theList))