Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/02advanced/06search-algorithm/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ students = [

![Binary search](./binary-search.drawio.svg)

この方法は整列されている場合にしか使えませんが、一回の処理ごとに半分の要素が候補から外れるので、時間計算量は $O(\log_2 n)$ となり線型探索よりも非常に速く解を求めることができます。
この方法は整列されている場合にしか使えませんが、一回の処理ごとに半分の要素が候補から外れるので、$\log_2 n$ 回の処理で終わります。
そのため、時間計算量は $O(\log n)$ となり線型探索よりも非常に速く解を求めることができます。

| データサイズ | $n$ | $\log n$ |
| ------------ | ----------- | -------- |
Expand Down