Last active
June 2, 2021 16:37
-
-
Save Park-Developer/bb34a112baf4eb3297506c00cc7d0c05 to your computer and use it in GitHub Desktop.
bubble sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 버블 정렬 알고리즘 구현하기 | |
from typing import MutableSequence | |
def bubble_sort(a:MutableSequence)-> None: | |
'''버블 정렬''' | |
n=len(a) | |
for i in range(n-1): | |
for j in range(n-1,i,-1): | |
if a[j-1]>a[j]: | |
a[j-1],a[j] = a[j],a[j-1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment