Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Code/bubbleSort.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ def bubbleSort(arr):
arr[j], arr[j+1] = arr[j+1], arr[j]

# Driver code to test above
arr = [64, 34, 25, 12, 22, 11, 90]

#arr = [64, 34, 25, 12, 22, 11, 90]
#instead of using a fixed size and fixed values/elements
#you can ask user to give the number as much he want

arr = list(map(int,input().split()))


bubbleSort(arr)

print ("Sorted array is:")
for i in range(len(arr)):
print ("%d" %arr[i]),
print(f"{arr[i]}")