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 of how a problem can be divided into smaller problems.
What is a base case in recursion?
Consider what happens if there’s no stopping condition.
What is recursion?
Think about returning to the same function during execution.
True or False: Every recursive function must have a base case.
Reflect on the purposes of stopping recursion.
Create a recursive function to generate all permutations of a string.
Consider how you can generate permutations by fixing one character and permuting the rest.
Write a recursive function that counts the number of digits in a number.
Think about how each digit is removed by integer division.
6 more questions in this section. Enroll free to practise them all.
Enroll free