Khác biệt giữa bản sửa đổi của “Sắp xếp nổi bọt”
Nội dung được xóa Nội dung được thêm vào
→Mã thật ví dụ: Thêm code Thẻ: Sửa đổi di động Sửa đổi từ trang di động |
|||
Dòng 87:
if(unsortedArray[index] > unsortedArray[index+1]) { //Test if need a swap or not.
temp = unsortedArray[index]; //These three lines just swap the two elements:
unsortedArray[index] =
unsortedArray[index+1] = temp;
}
|