1/7
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is recursion?
Function that includes a call to itself
When is recursion is used?
Used whenever one subtask is a smaller version of the original task.
What is divide and conquer?
General problem-solving technique of breaking down a task into subtasks
What is iterative version of a function?
Non-recursive version of a method (use loop instead)
What are the two elements of recursion?
One or more recursive calls
Stopping condition, or base case, where no recursion is required
What is infinite recursion?
A method runs until the computer runs out of resources, and the program terminates abnormally
What is the error you get for infinite recursion?
builtins.RuntimeError: maximum recursion depth exceeded in comparison
What is stack?
Regions of memory used to store temporary data, including function calls and local variables.