andz icon indicating copy to clipboard operation
andz copied to clipboard

Add tail-recursive versions of the recursive functions

Open nbro opened this issue 8 years ago • 0 comments

The concept of a tail-recursive function is especially important for functional programming languages. A tail-recursive function can be implemented in an optimized way by reusing the existing stack frame when calling recursively the function that is located in the tail position.

In the folder ands/algorithms/recursion, there are a few examples of recursive functions. The idea of this issue is to promote the:

  1. provision of a tail-recursive alternative implementation of the existing recursive functions (which are not already tail-recursive), and

  2. documentation of the functions as tail-recursive or not.

Resources

Possibly useful resources to implement this

nbro avatar Sep 08 '17 18:09 nbro