diff --git a/sortingbubble.py b/sortingbubble.py deleted file mode 100644 index 5e74711022c..00000000000 --- a/sortingbubble.py +++ /dev/null @@ -1,26 +0,0 @@ -# Python3 program for Bubble Sort Algorithm Implementation -def bubbleSort(arr): - - n = len(arr) - - # For loop to traverse through all - # element in an array - for i in range(n): - for j in range(0, n - i - 1): - - # Range of the array is from 0 to n-i-1 - # Swap the elements if the element found - #is greater than the adjacent element - if arr[j] > arr[j + 1]: - arr[j], arr[j + 1] = arr[j + 1], arr[j] - -# Driver code - -# Example to test the above code -arr = [ 2, 1, 10, 23 ] - -bubbleSort(arr) - -print("Sorted array is:") -for i in range(len(arr)): - print("%d" % arr[i])