andz
andz copied to clipboard
Add tail-recursive versions of the recursive functions
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:
-
provision of a tail-recursive alternative implementation of the existing recursive functions (which are not already tail-recursive), and
-
documentation of the functions as tail-recursive or not.
Resources
Possibly useful resources to implement this