fave77 / Mathball

A JavaScript library for Competitive Programming
https://fave77.github.io/Mathball-Docs/
MIT License
99 stars 49 forks source link

Optimising Fibonacci Number #146

Closed nilshah98 closed 5 years ago

nilshah98 commented 5 years ago

Do the checklist before filing the issue:

NOTE: Provide a clear and concise description of the feature that needs to be added! Or if its a bug, then provide the necessary steps to reproduce it along with screenshots.

Current solution uses brute approach to find nth fibonacci number. This issue requires one to convert the time complexity from O(n) to O(logn) by using Matrix Exponentiation to find nth fibonacci numbers.

Links- Fibonacci Number Matrix Exponentiation GFG
Use either Method5 or Method6 from above link

Related issues and PR-

64

5

Also, note that one needs to use Matrix Exponentiation library already created for Mathball under Mathball/src/matrixExponentiation

fave77 commented 5 years ago

@Ameenasuhani you're assigned!

fave77 commented 5 years ago

@Ameenasuhani your time's up!

Manvityagi commented 5 years ago

Can I take this ?

fave77 commented 5 years ago

@Manvityagi you're assigned