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 the base case in a recursive function?
Think about how the function knows when to stop.
Can you give an example of a problem that can be solved using direct recursion?
Consider functions that can be defined in terms of smaller inputs.
What is the purpose of the base case in recursion?
Think about what happens to the function without this condition.
True or False: A function can call itself indirectly through other functions.
Consider functions working in tandem instead of alone.
Write a recursive function that computes the nth Fibonacci number without using loops.
Break down Fibonacci definition into smaller parts.
Create a recursive function to print all elements of a list in reverse order.
Think of how you can isolate elements before reaching the base case.
6 more questions in this section. Enroll free to practise them all.
Enroll free