Last active
January 14, 2018 12:15
-
-
Save theWhiteFox/d6f0b7869b51b319f2f24ff180e092ae to your computer and use it in GitHub Desktop.
Revisions
-
Ó Conchubhair ♔ revised this gist
Jan 14, 2018 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,12 @@ // recursive. output starts at 0 function fib(number) { if(number == 0) return 0; if(number == 1) return 1; return fib(number - 2) + fib(number - 1); } // shorter recursive. output starts at 1 function fibRecursive(n) { if(n <= 1) return 1; return fibRecursive(n - 2) + fibRecursive(n - 1); } -
Ó Conchubhair ♔ created this gist
Jul 2, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // recursive. output starts at 0 function fib(number) { if(number == 0) return 0; if(number == 1) return 1; return fib(number - 2) + fib(number - 1); } // shorter recursive. output starts at 1 function fibRecursive(n) { if(n <= 1) return 1; return fibRecursive(n - 2) + fibRecursive(n - 1); }