Week 8 Flashcards
What is Mutual Recursion?
When two functions recursively call each other.
How does a conditional statement relate to recursion?
It is used to control the flow of recursion and avoid infinite loops
What is a typical numeric base case?
0 or 1
What is a typical string base case?
“” or a single character
What is a typical sequence base case?
Empty brackets
How do you do list mutation?
What is infinite recursion?
When a recursive function does not terminate after a finite number of calls
What is a node in a linked list?
A value and pointer to the next node in a linked list.
What is traversal of linked lists?
The process of visiting each node in the list, often used for searching, modifying, or counting elements