下列排序方法(sorting algorithm)中,以那一種排序法的平均速度最慢?
A基數排序(Radix sort algorithm)
B氣泡排序(Bubble sort algorithm)正確答案
C分而治之/各個擊破(divide and conquer)的合併排序(Merge sort algorithm)
D分而治之/各個擊破(divide and conquer)的快速排序(Quick sort algorithm)
答案與詳解
氣泡排序兩兩比較交換,平均與最壞皆 O(n²),是四者中最慢,常被當作慢速排序的代表。
