hacktoberfest icon indicating copy to clipboard operation
hacktoberfest copied to clipboard

Bubble sort

Open Srujan-Rao opened this issue 2 years ago • 6 comments

add bubble sort

Srujan-Rao avatar Oct 04 '22 12:10 Srujan-Rao

Hello, this is my first PR please assign this to me

Amitpawar88 avatar Oct 04 '22 12:10 Amitpawar88

Hello Srujan Rao, can i submit a PR on this issue ?

Samar1110 avatar Oct 04 '22 17:10 Samar1110

``from sys import stdin

def bubbleSort(arr, n) : for i in range(n-1): for j in range(n-i-1): if arr[j]> arr[j+1]: temp = arr[j] arr[j]= arr[j+1] arr[j+1] = temp

#Taking Input Using Fast I/O def takeInput() : n = int(stdin.readline().strip()) if n == 0 : return list(), 0

arr = list(map(int, stdin.readline().strip().split(" ")))
return arr, n

#to print the array/list def printList(arr, n) : for i in range(n) : print(arr[i], end = " ") print()

#main t = int(stdin.readline().strip())

while t > 0 :

arr, n = takeInput()
bubbleSort(arr, n)
printList(arr, n)

t-= 1

avigarg820 avatar Oct 07 '22 18:10 avigarg820

add bubble sort

I am submitting a code of bubble sort in python. I hope it is ok

avigarg820 avatar Oct 07 '22 18:10 avigarg820

hey there can i add bubble sort in python solution?

harshhes avatar Oct 08 '22 19:10 harshhes

please assign it to me

Yashmittal01 avatar Oct 14 '22 04:10 Yashmittal01