OpenGenus/cosmos

Fibonacci computed using Lucas's identities

Open

#2687 aperta il 29 ott 2017

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)C++ (3724 fork)batch import
Hacktoberfestadd codenew algorithm

Metriche repository

Star
 (13.462 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

This is a(n):

  • New algorithm
  • Update to an existing algorithm
  • Error
  • Proposal to the Repository

Details: Missing an example of Fibonacci number computation uses Lucas's identity. It computes the n-th Fibonacci number in O(log(n)). The implementation is much shorter and easier than well-known matrix based approach.

Guida contributor