-
-
Notifications
You must be signed in to change notification settings - Fork 607
Open
Description
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 -
[[1 1] [1 0]]^n = [[F_{n+1} F_n] [F_n F_{n-1}]]
This can be done with exponentiation by squaring which is O(log n).
Metadata
Metadata
Assignees
Labels
No labels