Skip to content

Instantly share code, notes, and snippets.

@Park-Developer
Last active June 2, 2021 16:37
Show Gist options
  • Save Park-Developer/bb34a112baf4eb3297506c00cc7d0c05 to your computer and use it in GitHub Desktop.
Save Park-Developer/bb34a112baf4eb3297506c00cc7d0c05 to your computer and use it in GitHub Desktop.
bubble sort
# 버블 정렬 알고리즘 구현하기
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