算法分析中 logN 的底数
参考书:
Data Structures and Algorithm Analysis in C
见:Big O notation Log Base 2 or Log Base 10
What we compare is the relative rates of growth, so it doesn’t matter what is the base of log.
According to the following theorem:
We can infer that:
Since is a constant, the relative rates of growth of and is the same.
但是,在数据结构与算法分析 C语言描述这本书中的 logN 默认都是以 为底数。见书第一章1.2.2:
In computer science, all algorithms are to the base 2 unless specified otherwise.