title: Recursive methods to create Streams in Scala
body: <p>This is a follow-up to <a href="https://stackoverflow.com/questions/8659127/how-to-fix-my-fibonacci-stream-in-scala">my previous question</a>.</p>
  
  <p>As I <a href="https://stackoverflow.com/a/8659299/650444">understand</a> the following method for calculating Fibonacci numbers is inefficient since the method <code>fib</code> is called for each Fibonacci number and each time it is called it creates a new stream.</p>
  
  <pre>def fib:Stream[Int] =
    Stream.cons(1, Stream.cons(1, (fib zip fib.tail) map {case (x, y) => x + y}))</pre> 
  
  <p>On other hand the <em>tail recursive</em> method (as in <a href="https://stackoverflow.com/questions/8659127/how-to-fix-my-fibonacci-stream-in-scala/8659691#8659691">here</a>) looks quite efficient and calculates each Fibonacci number in <code>O(1)</code></p>
  
  <pre>def fib(a:Int, b:Int):Stream[Int] = Stream.cons(a, fib(b, a+b));</pre>
  
  <p>Now I am concluding that recursive methods that create Streams are efficient <em>if and only if</em> they are tail recursive. Is it correct?</p>