Scala Reactive Programming
上QQ阅读APP看书,第一时间看更新

Scala tail-recursion

Recursion is a technique defined as using a function or method that calls itself again and again, until it solves the problem.

The recursion technique helps us solve simple problems very easily and even makes it possible to solve complex problems. It is easy to reason about and needs a lot less code, as compared to the iterative approach.

What kind of problems can we solve using the recursion technique? Any problem that is defined in terms of itself.