diff --git a/Bubble sort using python b/Bubble sort using python new file mode 100644 index 0000000..7571c0f --- /dev/null +++ b/Bubble sort using python @@ -0,0 +1,18 @@ +def bubbleSort(array): + + for i in range(len(array)): + + for j in range(0, len(array) - i - 1): + + if array[j] > array[j + 1]: + + temp = array[j] + array[j] = array[j+1] + array[j+1] = temp + +data = [-2, 45, 0, 11, -9] + +bubbleSort(data) + +print('Sorted Array in Ascending Order:') +print(data)