Skip to content

Instantly share code, notes, and snippets.

View thedeveloperr's full-sized avatar

Mohit Gupta thedeveloperr

View GitHub Profile
@thedeveloperr
thedeveloperr / bubbleSort.py
Created January 14, 2017 14:30
Bubble sort python implementation
def bubbleSort(l):
for n in range(len(l),1,-1):
no_switch = 0
for i in range(0,n-1):
if l[i] > l[i+1]:
l[i], l[i+1] = l[i+1], l[i]
switch+=1
if no_switch == 0:
break