Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is a base case in recursion?
Think about what would happen if recursion never stopped.
Define a recursive case.
What allows the function to work towards the base case?
What is the primary role of a base case in recursion?
Think about what would happen if recursion never stopped.
True or False: Stack overflow can occur if there are too many recursive calls.
Remember what happens with each function's call stack.
Implement a recursive function that computes the greatest common divisor (GCD) of two numbers.
Use the property: GCD(a, b) = GCD(b, a mod b).
Create a recursive function that generates a list of n Fibonacci numbers.
Think about how to combine previous definitions to create a list.
5 more questions in this section. Enroll free to practise them all.
Enroll free