Skip to content

feat: added binomial coefficient function and the corresponding test #10 #141

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

Merged

Conversation

Tcheumen
Copy link
Contributor

@Tcheumen Tcheumen commented Jul 2, 2023

The BinomialCoefficient function calculates the binomial coefficient of two input numbers, representing the number of ways to choose k elements from a set of n elements. The function follows the mathematical formula for binomial coefficients and returns the computed value.

Please review the code in this pull request.

Changes Made:

  • Added BinomialCoefficient function to calculate the binomial coefficient
  • Added parameter validation and error handling
  • Added tests for the BinomialCoefficient function

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. You could inline the numerator and denumerator variables. Note also that this isn't the most numerically stable way to compute the binomial coefficient.

@raklaptudirm raklaptudirm merged commit 24c861f into TheAlgorithms:master Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants