mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-04 15:39:42 +08:00
merge: Add FibonacciNumber.js test case and update the decription of function. (#840)
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
// https://en.wikipedia.org/wiki/Fibonacci_number
|
||||
|
||||
/**
|
||||
* @function Fibonacci
|
||||
* @description Fibonacci is the sum of previous two fibonacci numbers.
|
||||
* @param {Integer} N - The input integer
|
||||
* @return {Integer} fibonacci of N.
|
||||
* @see [Fibonacci_Numbers](https://en.wikipedia.org/wiki/Fibonacci_number)
|
||||
*/
|
||||
const fibonacci = (N) => {
|
||||
// creating array to store values
|
||||
const memo = new Array(N + 1)
|
||||
|
Reference in New Issue
Block a user