Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update time_complexity.md #1578

Merged
merged 3 commits into from
Dec 4, 2024
Merged

Update time_complexity.md #1578

merged 3 commits into from
Dec 4, 2024

Conversation

hopkings2008
Copy link
Contributor

  • correct the implement of exp_recur function and remove +1 operation from the function to simulate the cell division process

 * correct the implement of exp_recur function and remove +1 operation from the function to simulate the cell division process
@krahets
Copy link
Owner

krahets commented Dec 4, 2024

This function represents the “number of divisions” of the cells after n generations, not the "number of cells after" n generations.

For the latter, it should be:

/* 指数阶(递归实现) */
fn exp_recur(n: i32) -> i32 {
    if n == 0 {  # 
        return 1;
    }
    exp_recur(n - 1) + exp_recur(n - 1)
}

I will add a description to clarify this and avoid ambiguity.

@krahets krahets changed the title Bug fixes and improvements (#1577) Update time_complexity.md Dec 4, 2024
@krahets krahets added the documents documents-related label Dec 4, 2024
@krahets krahets merged commit ca774ee into krahets:main Dec 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documents documents-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants