Edit this page Backlinks This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Tail-end Recursion ====== Tail-end Recursion is an efficient way of writing recursive functions so that they use less memory on the stack and sometimes improve the complexity by recurring fewer times. However, in order to use the advantages of tail-end recursion compilers have to be optimized specifically to identify situations where the stack could be used more efficiently. The utility of Tail-end Recursion will be highlighted using a practical example involving a recursive procedure that computes the n-th Fibonacci number. ===== Fibonacci sequence ===== Let us consider the following code: <code> int fibo () { if (n < 2) { return n; } return f(n-1) + f(n-2); } </code>