Created
February 4, 2019 04:15
-
-
Save stevencurtis/dc8dc05a828b682ba775728fc3bb8f2f to your computer and use it in GitHub Desktop.
An recursive implementation of the Fibonacci series
This file contains 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 characters
func fib (_ n: Int) -> Int { | |
guard n > 1 else {return n} | |
return fib(n - 1) + fib(n - 2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment