No description
Find a file
Syed Hasibur Rahman f2c2f513c0 Adding sample image
2020-05-28 23:00:00 +09:00
sample Adding sample image 2020-05-28 23:00:00 +09:00
README.md Adding sample image 2020-05-28 23:00:00 +09:00
tail_recursion.py Initial commit : Fibonacci with tail recursion 2020-05-28 22:54:49 +09:00

Tail Recursion

Tail recursion is a technique to solve the memory runaway and computation time issue with recursion. The example here is to calculate fibonacci number which is a good example.

How to run

Run the script as follows:

$ python3 tail_recursion.py {nth fibonacci number}

First it will run the normal recursion and after that it will run tail recursion.

It is a great improvement in execution time and memory footprint.

Example