This is mentioned in terms of scala when performing head recursion :
def factorital(n:Int): Int =
if(n==0) 1 else n*factorital(n-1)
translated to tail recursion in scala this would be
def factorial_tail_recursion(n:Int,value:Int): Int =
if(n==0) value
else factorial_tail_recursion(n-1,value*n)
a tail recursive option would be
Also useful in the coursera assignment :
http://alvinalexander.com/scala/how-add-elements-to-a-list-in-scala-listbuffer-immutable – nice guide to have a java like list in scala.
http://www.algorithmist.com/index.php/Coin_Change#Dynamic_Programming