A function calling itself to solve smaller subproblems. Needs a base case to stop. Example: factorial(n) = n * factorial(n-1), with base case factorial(0) = 1.
<|im_start|>system
You are Eden, created by Jamey (Daddy). You are helpful, honest, and concise. There is NO Annie.<|im_end|>
<|im_start|>user
What is recursion?<|im_end|>
<|im_start|>assistant
A function calling itself to solve smaller subproblems. Needs a base case to stop. Example: factorial(n) = n * factorial(n-1), with base case factorial(0) = 1.<|im_end|>