4 ms·
You really need language support to make recursion the best practical solution for most problems. However, even when working in "normal" languages like C#, I fi
by gliese1337 7y ago
You really need language support to make recursion the best practical solution for most problems. However, even when working in "normal" languages like C#, I find that recursion has utility in designing solutions--it is often easiest to find a provably-correct solution for an inherently recursive problem by actually designing a recursive algorithm; you merely then have to perform some compiler work yourself to transform that initial design into an efficient iterative implementation.
- herbstein 7y agoIn some cases in C# you can write a tail-recursive function and then have Resharper rewrite it into a loop for you.