You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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>
rust版本,1.1.0版本里37页复杂度分析里,讲细胞分裂的例子,用递归的实现,rust的代码如下:
第 2 章 复杂度分析 hello‑algo.com 37
fn exp_recur(n: i32) -> i32 {
if n == 1 {
return 1;
}
exp_recur(n - 1) + exp_recur(n - 1) + 1 // 这里不应该有1, 应该把1去掉。 细胞分裂1分为2,2分为4, 4分为。有1的话,就变为1,3, 7 了。
}
The text was updated successfully, but these errors were encountered: