-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
feat: Add n_bonacci.cpp
in math section
#1544
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! 👍
Please enable GitHub Actions in your repository of this fork in this link: https://github.com/Swastyy/C-Plus-Plus/actions
math/n_bonacci.cpp
Outdated
* @param m is the number of terms in the N-Bonacci sequence | ||
* @returns the n-bonacci sequence as vector array | ||
*/ | ||
std::vector<int> N_bonacci(int n, unsigned int m) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using uint64_t
for non-negative values (or their appropriate size: uint32_t
, uint16_t
, uint8_t
) or int64_t
for negative values. Check other parts of the code (reference). 🙂
math/n_bonacci.cpp
Outdated
int main() { | ||
test(); // run self-test implementations | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work, @Swastyy; thank you! 😄👍🎉
@mishraabhinn See this PR has only my file. Check this out. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nobody has any objections, I'll merge this PR later today.
Description of Change Created n _ bonacci series upto given m number of terms.
Checklist
Notes: Fixes for https://github.com/TheAlgorithms/C-Plus-Plus/projects/6#card-63413779