Top "Tail-recursion" questions

Tail recursion is a recursive strategy in which a function does some amount of work, then invokes itself.

What is tail recursion?

Whilst starting to learn lisp, I've come across the term tail-recursive. What does it mean exactly?

algorithm language-agnostic functional-programming recursion tail-recursion
How do I break out of a loop in Scala?

How do I break out a loop? var largest=0 for(i<-999 to 1 by -1) { for (j<-i …

scala for-loop break tail-recursion
What is tail call optimization?

Very simply, what is tail-call optimization? More specifically, what are some small code snippets where it could be applied, and …

algorithm recursion language-agnostic tail-recursion tail-call-optimization
Understanding recursion

I'm having major trouble understanding recursion at school. Whenever the professor is talking about it, I seem to get it …

algorithm recursion tail-recursion
Does Python optimize tail recursion?

I have the following piece of code which fails with the following error: RuntimeError: maximum recursion depth exceeded I attempted …

python recursion stack stack-overflow tail-recursion
Which, if any, C++ compilers do tail-recursion optimization?

It seems to me that it would work perfectly well to do tail-recursion optimization in both C and C++, yet …

c++ optimization tail-recursion
Tail recursion in C++

Can someone show me a simple tail-recursive function in C++? Why is tail recursion better, if it even is? What …

c++ recursion g++ tail-recursion
Why doesn't .NET/C# optimize for tail-call recursion?

I found this question about which languages optimize tail recursion. Why C# doesn't optimize tail recursion, whenever possible? For a …

c# .net optimization tail-recursion
Are any JavaScript engines tail call (TCO) optimized?

I have a tail recursive pathfinding algorithm that I've implemented in JavaScript and would like to know if any (all?) …

javascript functional-programming tail-recursion
Are functions in JavaScript tail-call optimized?

I have been trying to understand Tail call optimization in context of JavaScript and have written the below recursive and …

javascript recursion tail-recursion