0
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 1 year has passed since last update.

image.png
1:探索アルゴリズム
「探索アルゴリズム」
①線形探索(アルゴリズム):手順の概要は1つずつ順番に、目的の値かどうかを比較していく。時間計算量:O(n)
②二分探索(アルゴリズム):データが整列されている場合に利用できる方法である。データが昇順(小さい順)に整列されている場合は、データを前半と後半に分けて、「中央の値>目的の値」であれば、前半を、「中央の値<目的の値」であれば、後半を探す。時間計算量:O(logn)
③ハッシュ法(アルゴリズム):ハッシュ関数を用いて、格納場所のアドレスを計算して、目的の異値を探す。データを事前にハッシュ表に登録しておく必要がある。時間計算量:O(1)

2:線形探索
 線形探索では、配列の先頭要素から順に探す値かどうかを調べます。

3:二分探索
 二分探索を行うためには、配列a中のデータを昇順に整列しておく必要があります。二分探索では、探索範囲の中央にあるデータとxを比較します。

0
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
0
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?