FlashKeepers

Computer Science · College · College and University

Data Structures, Unit 4: Recursion

Data Structures, unit: Recursion. Core concepts, terminology, and worked-example cues a college student meets for this unit, building on prior units without repeating them. Front: a term, concept, or short problem cue. Back: the definition, explanation, or answer.

About this set

38 basic cards for College Computer Science. Set 4 of 10 in Data Structures. It opens with "What is recursion?" and "What is a base case in recursion?". Study it alongside the other College sets below.

38 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is recursion?
Show answerA technique where a function calls itself to solve smaller instances of a problem
What is a base case in recursion?
Show answerThe condition that stops further recursive calls
What is a recursive case?
Show answerThe part of a function that calls itself with a smaller or simpler input
What happens if a recursive function has no base case?
Show answerIt results in infinite recursion, eventually causing a stack overflow
What is the call stack's role in recursion?
Show answerIt tracks each function call's state, unwinding as calls return
What is a classic example of a recursive algorithm?
Show answerComputing a factorial, or traversing a tree
What is the time complexity of a naive recursive Fibonacci function?
Show answerO(2^n), exponential, due to repeated redundant calculations
What technique improves recursive Fibonacci's efficiency by storing previously computed results?
Show answerMemoization
What is memoization?
Show answerCaching the results of expensive function calls to avoid redundant computation
What is tail recursion?
Show answerA recursive call that is the last operation performed in a function, allowing some compilers to optimize it
What is tail call optimization?
Show answerA compiler technique that reuses the current stack frame for a tail-recursive call, avoiding stack growth
What is an example of a naturally recursive data structure?
Show answerA tree, since each subtree is itself a smaller tree
What is the relationship between recursion and iteration?
Show answerAny recursive algorithm can be rewritten iteratively, often using an explicit stack
What is a recursive tree traversal?
Show answerVisiting nodes of a tree by recursively visiting children, such as in preorder, inorder, or postorder
What is mutual recursion?
Show answerTwo or more functions that call each other in a recursive cycle

23 more cards in the app

Study this set free