-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Fibonacci using matrix multiplication #10
Comments
hi Thank you, i will add solution using this approach later |
There's also a constant O(1) closed-form formula for the Nth fibonacci number - Binet's Formula |
@cktang88 uhmm, it's not? There's exponentiation here which uses at least |
@enedil yes, you're correct. The matrix exponentiation would be more efficient from a CS point of view. |
Hello.
I'm not fluent in Java so I won't implement it by myself, however there is an
O(log n)
solution for finding nth Fibonacci number which is based on matrix exponentiation -This can be done with exponentiation by squaring which is
O(log n)
.The text was updated successfully, but these errors were encountered: