bubble
![[알고리즘] bubble_sort 버블정렬(pseudo-code, 파이썬, Java)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FXb0i3%2FbtrhNe1Ljdb%2FAAAAAAAAAAAAAAAAAAAAAMtbuWCsh0AAzcnos0MexVjzJGBlIo2oWFBY7zEUBKSt%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1751295599%26allow_ip%3D%26allow_referer%3D%26signature%3D87vownx2MhUdFeVx7vLpCUwDJYU%253D)
[알고리즘] bubble_sort 버블정렬(pseudo-code, 파이썬, Java)
버블정렬 매 단계마다 처음부터 마지막까지 차례대로 인접한 두 원소를 비교하여 뒤에 있는 원소가 앞의 원소보다 작은 경우 두 원소를 교환 각 단계 수행 후 최대값이 마지막으로 이동하므로, 마지막 원소는 정렬대상에서 제외 Pseudo-code Algorithm bubbleSort(a, n) for i = n – 1 downto 1 for j = 0 to i-1 if(a[j] > a[j+1]) then int temp = a[index] a[index] = a[i] a[i] = temp Python def bubble_sort(arr): for i in range(len(arr)-1,0,-1): for j in range(i): if arr[j] > arr[j+1]: arr[j], arr[j+1] = arr[..