Chapter 3 Flashcards
What is a recursive definition?
A) A definition that specifies the entire sequence explicitly
B) A definition that defines a sequence using its previous terms
C) A definition that uses algebraic equations
D) A definition unrelated to sequences
B) A definition that defines a sequence using its previous terms
Which of the following is NOT true about recursively defined sequences?
A) They require a base case to start the recursion
B) They can define sequences using previous terms
C) They are always more efficient than explicit formulas
D) They require recursive relations to compute future terms
C) They are always more efficient than explicit formulas
Which of the following problems is most naturally solved using recursion?
A) Sorting an array
B) Calculating the factorial of a number
C) Iterating over elements in a list
D) Finding the maximum value in a list
B) Calculating the factorial of a number
What is a key disadvantage of recursive algorithms compared to iterative ones in C++?
A) They are slower to write
B) They use a stack, which may lead to memory overflow for large inputs
C) They always execute faster than iterative algorithms
D) They cannot handle complex problems
B) They use a stack, which may lead to memory overflow for large inputs
Which of the following is a key advantage of iterative algorithms over recursive algorithms?
A) They are easier to write
B) They always require fewer lines of code
C) They avoid stack overflow issues
D) They are more difficult to understand
C) They avoid stack overflow issues
What is a first-order linear recurrence relation?
A) A relation where each term is expressed in terms of two previous terms
B) A relation involving only one previous term and a constant coefficient
C) A non-linear relation between terms of a sequence
D) A formula to compute all terms directly
B) A relation involving only one previous term and a constant coefficient
What is the purpose of finding a closed-form solution for a recurrence relation?
A) To simplify the computation of terms
B) To make a problem more recursive
C) To compute terms without solving recursively
D) Both A and C
D) Both A and C