mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-24 09:46:29 +08:00
Update time_complexity.md (#1578)
* Bug fixes and improvements (#1577) * correct the implement of exp_recur function and remove +1 operation from the function to simulate the cell division process * Update time_complexity.rs * Update time_complexity.md --------- Co-authored-by: zouy26 <zouy26@chinaunicom.cn> Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
parent
2a9db6d039
commit
ca774eefbf
1 changed files with 1 additions and 1 deletions
|
@ -1120,7 +1120,7 @@ $$
|
||||||
|
|
||||||
生物学的“细胞分裂”是指数阶增长的典型例子:初始状态为 $1$ 个细胞,分裂一轮后变为 $2$ 个,分裂两轮后变为 $4$ 个,以此类推,分裂 $n$ 轮后有 $2^n$ 个细胞。
|
生物学的“细胞分裂”是指数阶增长的典型例子:初始状态为 $1$ 个细胞,分裂一轮后变为 $2$ 个,分裂两轮后变为 $4$ 个,以此类推,分裂 $n$ 轮后有 $2^n$ 个细胞。
|
||||||
|
|
||||||
下图和以下代码模拟了细胞分裂的过程,时间复杂度为 $O(2^n)$ :
|
下图和以下代码模拟了细胞分裂的过程,时间复杂度为 $O(2^n)$ 。请注意,输入 $n$ 表示分裂轮数,返回值 `count` 表示总分裂次数。
|
||||||
|
|
||||||
```src
|
```src
|
||||||
[file]{time_complexity}-[class]{}-[func]{exponential}
|
[file]{time_complexity}-[class]{}-[func]{exponential}
|
||||||
|
|
Loading…
Reference in a new issue