diff --git a/bubbleSort.py b/bubbleSort.py new file mode 100644 index 0000000..5bc2087 --- /dev/null +++ b/bubbleSort.py @@ -0,0 +1,17 @@ +lis = [] +n = int(input("no of elements : ")) +print("elements : ") +def bubbleSort(lis,n): + for i in range(n): + temp = int(input()) + lis.append(temp) + print(lis) + for i in range(n): + for j in range(n-i-1): + if (lis[j]>lis[j+1]): + c = lis[j] + lis[j] = lis[j+1] + lis[j+1] = c + print(lis) + +bubbleSort(lis,n) \ No newline at end of file