From 5a7f4242ddd1fbeeb62f1f799cbc6f75ee99f180 Mon Sep 17 00:00:00 2001 From: Dhanu singh <43619293+Dhanu-29@users.noreply.github.com> Date: Sat, 6 Oct 2018 22:27:59 -0700 Subject: [PATCH] Update bubbleSort.py --- bubbleSort.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bubbleSort.py b/bubbleSort.py index ab0c2d6..1ffea7d 100644 --- a/bubbleSort.py +++ b/bubbleSort.py @@ -2,7 +2,7 @@ a = [int(i) for i in input().split()] for i in range(len(a)-1): - for j in range(len(a)-1): + for j in range(0,len(a)-1): if a[j] > a[j+1]: # swap= ar[j]; # ar[j] =ar[j+1]; @@ -10,4 +10,4 @@ a[j], a[j+1] = a[j+1] , a[j]; -print("Acending Order Sorted Array" ,a) \ No newline at end of file +print("Acending Order Sorted Array" ,a)