Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
1k views

Generating Fibonacci sequences in Scala

Would you consider this to be idiomatic Scala? If not, what would you do to improve it? ...
Don Branson's user avatar
3 votes
1 answer
1k views

Memoization of Fibonacci using generic Int => Int helper

I'm trying to understand memoization using Scala. I took the Fibonacci sequence as an example because of the high cost of recursively computing numbers in the sequence without memoization. ...
TooTone's user avatar
  • 153
2 votes
2 answers
2k views

Tail Recursive Fibonacci

Please critique my implementation of a tail-recursive method for generating the Fibonacci sequence: ...
Kevin Meredith's user avatar
1 vote
1 answer
572 views

Better way of calculating Project Euler #2 (Fibonacci sequence)

Even Fibonacci numbers Problem 2 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3,...
firephil's user avatar
  • 213
5 votes
2 answers
1k views

Producing full list of Fibonacci numbers which fit in an Int

I am progressing through the problems listed at projecteuler.com as I learn Scala (my blog where I am covering this experience). I have written a function to produce all the Fibonacci numbers possible ...
chaotic3quilibrium's user avatar