LoginSignup
25
8

More than 5 years have passed since last update.

O(log N)の底は何なのか

Last updated at Posted at 2017-02-01

アルゴリズムの計算量を評価するときに、O記法がよく用いられます。
O(log N)は、Nが十分に大きければ、その関数はlog Nに比例するということを意味します。

ところで、このlogの底は何なんでしょうか?

答え

気にしなくても良い。

対数の底の変換公式を使うと、以下のように変形できるので、底については気にしなくても良いです。

\begin{align}
\log _a b &= \frac{1}{\log a} \times \log b \\
          &= O(\log b)
\end{align}
25
8
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
25
8