Skip to content

Instantly share code, notes, and snippets.

@stephenLee
Created September 13, 2012 13:43
Show Gist options
  • Save stephenLee/3714379 to your computer and use it in GitHub Desktop.
Save stephenLee/3714379 to your computer and use it in GitHub Desktop.
non tail recursive version of factorial
def factorial(n: Int): Int = {
if (n==0) 1 else n * factorial(n-1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment