Top "Recursion" questions

Recursion is a kind of function call in which a function calls itself.

Tower of Hanoi: Recursive Algorithm

Although I have no problem whatsoever understanding recursion, I can't seem to wrap my head around the recursive solution to …

recursion towers-of-hanoi
Searching for file in directories recursively

I have the following code to recursively search for files through a directory, which returns a list of all xml …

c# recursion
Recursive Fibonacci

I'm having a hard time understanding why #include <iostream> using namespace std; int fib(int x) { if (x == 1) { …

c++ recursion fibonacci
Recursion or Iteration?

Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both …

performance algorithm language-agnostic recursion
Calling a javascript function recursively

I can create a recursive function in a variable like so: /* Count down to 0 recursively. */ var functionHolder = function (counter) { output(…

javascript function recursion function-expression
Node.js - Maximum call stack size exceeded

When I run my code, Node.js throws a "RangeError: Maximum call stack size exceeded" exception caused by too many …

node.js recursion stack-overflow callstack
List all the files and folders in a Directory with PHP recursive function

I'm trying to go through all of the files in a directory, and if there is a directory, go through …

php recursion
Way to go from recursion to iteration

I've used recursion quite a lot on my many years of programming to solve simple problems, but I'm fully aware …

recursion iteration language-agnostic computer-science theory
Python: maximum recursion depth exceeded while calling a Python object

I've built a crawler that had to run on about 5M pages (by increasing the url ID) and then parses …

python algorithm recursion web-crawler depth
Is recursion ever faster than looping?

I know that recursion is sometimes a lot cleaner than looping, and I'm not asking anything about when I should …

performance loops recursion iteration