ソートアルゴリズム比較一覧

ファイル更新: 2026-06-18 行数: 8 列数: 7
更新履歴(1回)
  • 2026-06-18T11:03:21+09:00 / 8行 / ?????????
操作
元CSVをダウンロード
列表示ON/OFF
読み込み中...
algorithm best average worst space stable note
Bubble sort O(n) O(n^2) O(n^2) O(1) yes 単純で教育向き
Selection sort O(n^2) O(n^2) O(n^2) O(1) no 交換回数は少ない
Insertion sort O(n) O(n^2) O(n^2) O(1) yes ほぼ整列済みに強い
Merge sort O(n log n) O(n log n) O(n log n) O(n) yes 分割統治で安定
Quick sort O(n log n) O(n log n) O(n^2) O(log n) no 平均は高速
Heap sort O(n log n) O(n log n) O(n log n) O(1) no ヒープを利用
Counting sort O(n+k) O(n+k) O(n+k) O(k) yes 整数キー向けの非比較ソート
Radix sort O(nk) O(nk) O(nk) O(n+k) yes 桁ごとに整列する非比較ソート