Anonymous user
Category:Recursion: Difference between revisions
m
Spelling/grammar
(Added more explanation with more links) |
m (Spelling/grammar) |
||
Line 1:
'''Recursion''' is the idea that a function can come to an answer by repeatedly calling itself with new arguments until a "base case" or "end condition" is met. One good example is a factorial function. The base case for factorial is "0!" (some people like to use 1 or 2, but for instructional purposes 0 is OK). When 5 is sent as an argument to a recursive factorial function, the function does
A pseudocode function to demonstrate recursion would look something like this:
|