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.
What is a base case in recursion?
Think about what prevents infinite loops.
What happens if you ignore the base case?
Consider what happens if a function keeps calling itself endlessly.
What is recursion?
Consider how a function's definition involves its use.
True or False: Every recursive function must have both base and recursive cases.
Think about what happens without either case.
Write a recursive function that checks if a given string is a palindrome.
Think of how to compare characters from the ends towards the middle.
Demonstrate how to generate all permutations of a list using recursion.
Consider fixing a single element and permuting the rest.
6 more questions in this section. Enroll free to practise them all.
Enroll free