Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a69a305

Browse files
author
Muh. Angga Muttaqien
committed
Modify bubble sort
1 parent 3e2bd2f commit a69a305

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎sorting/bubble-sort.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ def bubble_sort(collection):
55
for i in range(length-1, -1, -1):
66
for j in range(i):
77
if collection[j] > collection[j+1]:
8-
collection[j], collection[j+1] = collection[j+1], collection[j]
8+
collection[j], collection[j+1] = (
9+
collection[j+1], collection[j]
10+
)
911

1012
return collection
1113

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /