-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
added improved Fibonacci sequence number finder with dynamic programming #223
added improved Fibonacci sequence number finder with dynamic programming #223
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.
Please update the copyright year in the files.
Changes LGTM
@iluwatar please review this PR. |
README.md
Outdated
/** | ||
* Fibonacci series using dynamic programming. Works for larger ns as well. | ||
* | ||
* @param n given number | ||
* @return fibonacci number for given n | ||
*/ | ||
public static int fibonacciBig(int n) { | ||
int previous = 0; | ||
int current = 1; | ||
for (int i = 0; i < n - 1; i++) { | ||
int t = previous + current; | ||
previous = current; | ||
current = t; | ||
} | ||
|
||
return current; | ||
} | ||
|
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.
I don't think this is the correct position in the README.md. Check below, there is already another Fibonacci implementation.
ac19053
to
92483c3
Compare
Quality Gate failedFailed conditions |
Looks good! Thank you for the contribution 🎉 |
Implemented a dynamic programming approach to optimize the Fibonacci sequence number finder for improved efficiency.