/factorial.rb Secret
Last active
November 27, 2023 01:05
-
Star
(0)
You must be signed in to star a gist -
Fork
(113)
You must be signed in to fork a gist
-
-
Save nextacademy-private/91fb2e5d3e58251babd9 to your computer and use it in GitHub Desktop.
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 characters
# Implement an iterative version of the factorial function | |
def factorial_iterative(n) | |
end | |
# Implement a recursive version of the factorial function | |
def factorial_recursive(n) | |
end | |
puts factorial_recursive(9) == 362880 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inception All Over Again: Recursion, Factorials, And Fibonacci In Ruby
https://www.natashatherobot.com/recursion-factorials-fibonacci-ruby/