What this deck covers
This deck focuses on Recursion, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study Recursion in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
What is the term for the part of a recursive function where it calls itself?
Tap card or press Space to flip
Recursive call. The self-referential part of recursive functions.
How well did you know it?
Card 1 / 80
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Recursion, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: Recursive call. The self-referential part of recursive functions.
Answer: F(n)=F(n−1)+F(n−2) with base cases F(0)=0,F(1)=1. Each term is the sum of the two preceding terms.
Answer: Recursive call is the last operation in the function. Optimization where recursion is the final operation performed.
Answer: Occurs when recursion exceeds the stack size limit. Runtime error from excessive recursive calls.
Answer: Recursive call: sum(n-1);. The line where the function invokes itself with modified parameters.
Answer: Trying all possibilities via recursion to solve a problem. Systematic exploration with backtracking on failure.
Answer: An algorithm that solves a problem by solving smaller instances of the same problem. Breaks problems down into smaller versions of themselves.
Answer: Recursive call: gcd(b, a%b);. Euclidean algorithm implementation using recursion.
Answer: To manage additional parameters or initial setup. Simplifies recursive function interfaces and setup.
Answer: Recursion is a method where a function calls itself. Self-referential programming technique for solving complex problems.
Answer: Manages function calls and returns during recursion. LIFO structure tracking function call hierarchy.
Answer: A data structure defined in terms of a smaller version of itself, like linked lists. Self-referential structures like trees and linked lists.
Answer: Stack overflow due to infinite recursion. Missing base case leads to memory exhaustion.
Answer: Base case: if (n==0) return 1;. The stopping condition that prevents infinite recursion.
Answer: Recursive call is the last operation in the function. Optimization where recursion is the final operation performed.
Answer: F(n)=F(n−1)+F(n−2) with base cases F(0)=0,F(1)=1. Each term is the sum of the two preceding terms.
Answer: A function used to simplify recursive calls by handling initial parameters. Auxiliary function that assists the main recursive function.
Answer: Simplifies code for problems that have recursive structure. Elegant solution for naturally hierarchical problems.
Answer: Prevents infinite recursion and stack overflow. Ensures recursion terminates properly.
Answer: Recursive call: reversePrint(arr, n-1);. Self-call that processes remaining array elements.
Answer: Breaking a problem into smaller subproblems and solving them recursively. Problem-solving strategy using recursive decomposition.
Answer: Trying all possibilities via recursion to solve a problem. Systematic exploration with backtracking on failure.
Answer: May lead to high memory use due to call stack. Each call adds a frame to the call stack.
Answer: Recursion uses self-calling functions; iteration uses loops. Recursion uses function calls; iteration uses loops.
Answer: Understanding the call stack and flow of recursive calls. Complex execution flow makes tracing difficult.
Answer: To stop recursion and prevent infinite loops. Essential terminating condition for recursive functions.
Answer: Function's local variables, parameters, and return address. Information stored for each recursive call.
Answer: Breaking a problem into smaller subproblems and solving them recursively. Problem-solving strategy using recursive decomposition.
Answer: Base case: if (start >= end) return true;. Condition when string indices meet or cross.
Answer: Recursive call: power(x, n-1);. Exponentiation using recursive multiplication.
Answer: Problems with a naturally recursive structure, like tree traversals. Hierarchical or self-similar problem structures.
Answer: Stack overflow due to infinite recursion. Missing base case leads to memory exhaustion.
Answer: n!=n×(n−1)! with base case 0!=1. Product of all positive integers up to n.
Answer: A top-down parser built from a set of mutually recursive procedures. Parsing technique using recursive grammar rules.
Answer: Missing base case. No terminating condition leads to infinite recursion.
Answer: Recursion uses self-calling functions; iteration uses loops. Recursion uses function calls; iteration uses loops.
Answer: A data structure defined in terms of a smaller version of itself, like linked lists. Self-referential structures like trees and linked lists.
Answer: Base case: if (start >= end) return true;. Condition when string indices meet or cross.
Answer: Add base case: if (n==0) return 1;. Missing termination condition causes infinite recursion.
Answer: Recursion can be more intuitive for problems with a recursive nature. Natural mapping to problem structure and readability.
Answer: Occurs when recursion exceeds the stack size limit. Runtime error from excessive recursive calls.
Answer: Two or more functions call each other. Functions form a calling cycle among themselves.
Answer: Recursive call: power(x, n-1);. Exponentiation using recursive multiplication.
Answer: Recursion limit or stack depth limit. System limitation preventing stack overflow errors.
Answer: May lead to high memory use due to call stack. Each call adds a frame to the call stack.
Answer: An algorithm that solves a problem by solving smaller instances of the same problem. Breaks problems down into smaller versions of themselves.
Answer: A function used to simplify recursive calls by handling initial parameters. Auxiliary function that assists the main recursive function.
Answer: A top-down parser built from a set of mutually recursive procedures. Parsing technique using recursive grammar rules.
Answer: Base case: if (n==0) return 1;. The stopping condition that prevents infinite recursion.
Answer: Recursive call: sum(n-1);. The line where the function invokes itself with modified parameters.
Answer: To stop recursion and prevent infinite loops. Essential terminating condition for recursive functions.
Answer: Prevents infinite recursion and stack overflow. Ensures recursion terminates properly.
Answer: Problems with a naturally recursive structure, like tree traversals. Hierarchical or self-similar problem structures.
Answer: Function's local variables, parameters, and return address. Information stored for each recursive call.
Answer: Understanding the call stack and flow of recursive calls. Complex execution flow makes tracing difficult.
Answer: A visual representation of recursive function calls. Diagram showing recursive call relationships and flow.
Answer: Missing base case. No terminating condition leads to infinite recursion.
Answer: Base case: if (n==0) return;. The terminating condition that stops recursion.
Answer: Add base case: if (n==0) return 1;. Missing termination condition causes infinite recursion.
Answer: Recursive call. The self-referential part of recursive functions.
Answer: Recursion limit or stack depth limit. System limitation preventing stack overflow errors.
Answer: A visual representation of recursive function calls. Diagram showing recursive call relationships and flow.
Answer: Caching results of expensive function calls to avoid recalculations. Dynamic programming technique to optimize recursive algorithms.
Answer: Simplifies code for problems that have recursive structure. Elegant solution for naturally hierarchical problems.
Answer: Base case: if (n<=0) return 0;. Prevents accessing elements beyond array bounds.
Answer: Two or more functions call each other. Functions form a calling cycle among themselves.
Answer: Recursive call: reversePrint(arr, n-1);. Self-call that processes remaining array elements.
Answer: Recursive call: gcd(b, a%b);. Euclidean algorithm implementation using recursion.
Answer: Recursion can be more intuitive for problems with a recursive nature. Natural mapping to problem structure and readability.
Answer: Direct: function calls itself; Indirect: function calls another that calls it. Direct calls itself; indirect calls through other functions.
Answer: Caching results of expensive function calls to avoid recalculations. Dynamic programming technique to optimize recursive algorithms.
Answer: Base case: if (n==0) return;. The terminating condition that stops recursion.
Answer: Direct: function calls itself; Indirect: function calls another that calls it. Direct calls itself; indirect calls through other functions.
Answer: Recursion is a method where a function calls itself. Self-referential programming technique for solving complex problems.
Answer: To manage additional parameters or initial setup. Simplifies recursive function interfaces and setup.
Answer: Base case: if (n<=1) return n;. Handles the terminating conditions for small inputs.
Answer: Base case: if (n<=0) return 0;. Prevents accessing elements beyond array bounds.
Answer: Base case: if (n<=1) return n;. Handles the terminating conditions for small inputs.
Answer: n!=n×(n−1)! with base case 0!=1. Product of all positive integers up to n.
Answer: Manages function calls and returns during recursion. LIFO structure tracking function call hierarchy.