跳至主要內容
冒泡排序 Bubble sort

冒泡排序 Bubble sort

原理

先看看Wikipedia的定义:

Bubble sort is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.


莫林...大约 4 分钟数据结构与算法冒泡排序排序Javascript