Skip to content

Fibonacci using matrix multiplication #10

@enedil

Description

@enedil

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions