Skip to content

Tag Archives: tail-recursion

Write a tail recursive function for calculating the n-th Fibonacci number. Examples :   Input : n = 4 Output : fib(4) = 3 Input : n… Read More
What is Recursion? The process in which a function calls itself directly or indirectly is called recursion and the corresponding function is called as recursive function.… Read More
We have discussed (in tail recursion) that a recursive function is tail recursive if the recursive call is the last thing executed by the function. … Read More
What is tail recursion? A recursive function is tail recursive when a recursive call is the last thing executed by the function. For example the following… Read More