public static void bubbleSort(int[] arr) {
final int length = arr.length;
int iTmp = 0;
for (int iCnt = 0; iCnt < length; iCnt++) { //배열의 길이만큼 도는데
for (int iCn = 0; iCn < length - iCnt - 1; iCn++) { //0~size -1까지
if (arr[iCn] > arr[iCn + 1]) {
iTmp = arr[iCn];
arr[iCn] = arr[iCn + 1];
arr[iCn + 1] = iTmp;
}
}
System.out.print((iCnt + 1) + "번째 과정 ");
for (int iPos : arr)
System.out.print(iPos + " ");
System.out.println();