Blogger

Delete comment from: The War on Guns

DDS said...

The professor is dabbling about with a technique known as "recursion". Now, recursion is a powerful tool and can easily solve problems that would be difficult to solve using most other techniques. But as with all powerful tools, one must be careful lest one's powerful tool turn and bite one on the butt.

In inexperienced hands, recursion can and most likely will, drop one into the dreaded "infinite loop".

https://en.wikipedia.org/wiki/Recursion

Recursion used incorrectly:

recursion def: noun -- see recursion

recursion used correctly:

unsigned int factorial(unsigned int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}

Nov 17, 2020, 7:55:49 PM


Posted to Proof of Guilt

Google apps
Main menu