function bubbleSort(arr) {
let n = arr.length;
for (let i = 0; i < n-1; i++) {
for (let j = 0; j < n-i-1; j++) {
if (arr[j] > arr[j+1]) {
// arr[j+1]과 arr[j] 교체
let temp = arr[j] ARR [J+1];
let arr = [64, 34, 25, 12, 22, 11, 90];
console.log("정렬 전 배열: ");
console.log(arr.join (" ") );
arr = bubbleSort(arr);
console.log("정렬된 배열: ");
console.log(arr.join(" "));