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

Types of recursions

We can implement recursion in different ways. However, we are considering only the following two types:

  • Linear recursion
  • Tail-recursion

Tail-recursion is one form of recursion technique. We can say a recursive call is tail-recursive, when a recursive call is the last thing executed by that function and it does nothing after that, just returns its value.