頁:
[1]
bubble sort
Bubble Sort 氣泡排序假設一些數字 6, 3, 9, 2, 1, 4
用C/C++
顯示出
Initial: 6 3 9 2 1 4
Pass1: 3 6 2 1 4 9
Pass2: 3 2 1 4 6 9
Pass3: 2 1 3 4 6 9
Pass4: 2 1 3 4 6 9
Pass5: 1 2 3 4 6 9
請教一下
感嗯喔!
<div></div> Bubble sort is a simple sort algorithm that is easy to understand, but there are other better sort algorithms such as quick sort and merge sort. If your array is small, it doesn't matter much, but if you have hundreds or thousands of elements in your array, it'd better to spend some time to use the better sort algorithms.
頁:
[1]