From da544fd3719ea11bdb49929ac01e9e61afcb5c57 Mon Sep 17 00:00:00 2001 From: SAM <73647831+samhackathon@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:33:14 +0500 Subject: [PATCH] Delete sortingbybubble.py --- sortingbybubble.py | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 sortingbybubble.py diff --git a/sortingbybubble.py b/sortingbybubble.py deleted file mode 100644 index 5e74711022c..00000000000 --- a/sortingbybubble.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])