BUBBLE_SORT(A)
for i ← length[A] to 2
for j ← 1 to i-1
if( A[j] >= A[j+1] )
A[j] <---> A[j+1]
时间复杂度:O(n^2)