Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Define recursion in your own words.
Think about the definition we covered in class.
What is the role of a base case?
Consider what happens if a base case wasn't there.
What is recursion?
Think about the elements involved in recursion.
True or False: Every recursive function must have a base case.
Consider the consequences of not having a stopping condition.
Write a recursive function that prints numbers from n to 1. Explain how you handle the base case.
What do you think the stopping point of your function should be?
How would you implement memoization in the Fibonacci function to optimize it? Provide an example.
Think about where you could place a condition to check for previously computed values before the recursive calls.
5 more questions in this section. Enroll free to practise them all.
Enroll free