Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【基本情報・応用情報】アルゴリズムだああああ!種類・計算量・動き

Posted at

はじめに

基本情報や応用情報でのアルゴリズムを一気に復習できるような記事です!

データ構造やプログラミングの基礎知識については記述していないので,事前に学んでおいてください.

探索アルゴリズム

特徴 計算量 補足
線形探索 先頭から順に探索 O(n) ソート不要
2分探索 中央値と比較し範囲を半減 O(log n) ソート必要
ハッシュ探索 キーをハッシュ関数で変換 O(1) 衝突対策が必要

整列アルゴリズム

特徴 計算量 安定
選択法 最小値を選んで順に並べる O(n^2) X
バブルソート 隣接要素を比較・交換 O(n^2)
挿入法 要素を適切な位置に挿入 O(n^2)
シェルソート 挿入法の改良版,一定間隔をあけて行う O(n^2)
クイックソート 分割統治法、ピボットで分割 O(n log n) X
ヒープソート ヒープ構造を利用 O(n log n) X
マージソート 分割統治法、部分列を比較してマージ O(n log n)

選択ソート

バブルソート

挿入ソート

画像








シェルソート

クイックソート

image.png
image.png
image.png
image.png
image.png

ヒープソート

image.png
image.png
image.png
image.png
image.png

マージソート

image.png
image.png
image.png

2
2
1

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

@bearl27's pickup articles

bearl27

@bearl27

立命館大学 / RCC副執行委員長 好きな言語:TypeScript c# cpp 好きな筋肉:大胸筋 物理的にも技術力的にも強強なエンジニアになる💪
rits-rcc
立命館大学の情報系サークルです。情報系のことならなんでもやっています!!

Comments

mikecat_mixc
@mikecat_mixc

シェルソートの「安定」のところに◯がついていますが、シェルソートは安定ソートではないかもしれないですね。

シェルソート - Wikipedia

ただし、挿入ソートと異なり、安定ソートではなくなる。

0

Let's comment your feelings that are more than good

Qiita Conference 2024 Autumn will be held!: 11/14(Thu) - 11/15(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

Takahiro Anno, Masaki Fujimoto, Yukihiro Matsumoto(Matz)

View event details

Being held Article posting campaign

2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address