Skip to content

Instantly share code, notes, and snippets.

@nextacademy-private
Last active November 27, 2023 01:05
Show Gist options
  • Save nextacademy-private/91fb2e5d3e58251babd9 to your computer and use it in GitHub Desktop.
Save nextacademy-private/91fb2e5d3e58251babd9 to your computer and use it in GitHub Desktop.
# 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
@dancomanlive
Copy link

Inception All Over Again: Recursion, Factorials, And Fibonacci In Ruby
https://www.natashatherobot.com/recursion-factorials-fibonacci-ruby/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment