5 ms·
> Recursion requires [dynamic memory allocation] in some form to avoid overwriting a procedure's variables upon the recursive call. Technically untrue, actuall
by a1369209993 4y ago
> Recursion requires [dynamic memory allocation] in some form to avoid overwriting a procedure's variables upon the recursive call.
Technically untrue, actually; you can require any potentially-recursive procedure to take a (pointer to a) array of stack frames to use when making a recursive call. However I don't know of any programming languages that actually do that, rather than supporting stack frames implicitly or (historically) prohibiting recursion altogether.
- shadowofneptune 4y agoHaving an explicit stack as part of the algorithm is not usually counted as recursion, as far as I know.