Skip to content

Commit

Permalink
Create mojtabatmj.py
Browse files Browse the repository at this point in the history
add BubbleSort def in BubbleSort Folder
#Hacktoberfest
  • Loading branch information
Moji TMJ authored Oct 15, 2017
1 parent 2e4b739 commit 4986285
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions BubbleSort/mojtabatmj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def bubbleSort(K):
for passnum in range(len(K)-1,0,-1):
for i in range(passnum):
if K[i]>K[i+1]:
temp = K[i]
K[i] = K[i+1]
K[i+1] = temp

A = [9,99,88,55,2,3,64,7,125,44]
bubbleSort(A)
print(A)

0 comments on commit 4986285

Please sign in to comment.