Skip to content

Instantly share code, notes, and snippets.

@oehme
Last active December 15, 2015 01:38
Show Gist options
  • Save oehme/5180879 to your computer and use it in GitHub Desktop.
Save oehme/5180879 to your computer and use it in GitHub Desktop.
Memoized fibonacci method - Xtend source
@Memoize def BigInteger fibonacci(int n) {
switch n {
case 0: 0bi
case 1: 1bi
default: fibonacci(n - 1) + fibonacci(n - 2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment