1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

典型的なアルゴリズムの計算量と安定ソートをわかりやすく表にしてみた

1
Last updated at Posted at 2022-02-02

1.ソートの表まとめ

ソート名 最良の時間計算量 平均時間計算量 最悪時間計算量 安定性
バブルソート O(n^2) O(n^2) O(n^2) 安定
選択ソート O(n^2) O(n^2) O(n^2) 不安定
挿入ソート O(n^2) O(n^2) O(n^2) 安定
マージソート O(nlogn) O(nlogn) O(nlogn) 安定
クイックソート O(nlogn) O(nlogn) O(n^2) 不安定
シェルソート O(nlogn) O(nlogn) O(n^2) 不安定
ヒープソート O(nlogn) O(nlogn) O(nlogn) 不安定
計数ソート O(n) O(n+k) O(n+k) 安定
基数ソート O(n) O(d(n+k)) O(d(n+k)) 安定
パケットソート O(n) O(n+n^2/k+k) O(n^2) 安定

2.参考記事

計算量オーダーについて

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?