# Comparing Time Complexity

Yao Yao on August 3, 2020

Question: Sort the following terms from slowest growing to fastest growing.

$(\log_2 n + 1)^3 \quad 7^{2n} \quad n^{\frac{1}{2}} \quad n^{\log_3 7} \quad 2^{7n} \quad 1000 (\log_2 n)^3 \quad 2^{\log_2 n} \quad n \log n \quad 5^{\log_3 n}$

• $2^{\log_2 n} = n$
• $5^{\log_3 n} = n^{\log_3 5}$

• $(\log_2 n + 1)^3 < 1000 (\log_2 n)^3$
• $n^{\frac{1}{2}} < 2^{\log_2 n} < n \log n$
• $5^{\log_3 n} < n^{\log_3 7} < 7^{2n} < 2^{7n}$

• $1000 (\log_2 n)^3 < n^{\frac{1}{2}}$
• $n \log n < 5^{\log_3 n}$

### 3. 综上

$(\log_2 n + 1)^3 < 1000 (\log_2 n)^3 < n^{\frac{1}{2}} < 2^{\log_2 n} < n \log n < 5^{\log_3 n} < n^{\log_3 7} < 7^{2n} < 2^{7n}$