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.
Define recursion in your own words.
Think about how problems can be broken down into smaller parts.
What is the output of factorial(4)?
Remember the definition of factorial.
What is recursion?
Remember the definition related to functions.
True or False: A proper base case is essential to prevent infinite recursion.
Think about what keeps the process from running forever.
Write a recursive function that computes the greatest common divisor (GCD) of two numbers.
Think about how you can reduce the problem size using division.
Consider a scenario where a recursion leads to a stack overflow. Propose a solution to prevent this.
What alternatives exist to recursion for solving problems?
6 more questions in this section. Enroll free to practise them all.
Enroll free