diff --git a/bubbleSORT.java b/bubbleSORT.java index 12d493a..6ecbe15 100644 --- a/bubbleSORT.java +++ b/bubbleSORT.java @@ -15,7 +15,7 @@ public static void main(String [] args){ for(i = 0; i < arr.length; i ++){ - for(j = 0; j < arr.length - 1 ;j++){ + for(j = 0; j < arr.length - 1 -i ;j++){ // -i makes the loop more optimised if(arr[j] > arr[j+1]){