Chapter 3 Flashcards

1
Q

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

A

B) A definition that defines a sequence using its previous terms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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

A

C) They are always more efficient than explicit formulas

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

A

B) Calculating the factorial of a number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

B) They use a stack, which may lead to memory overflow for large inputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

C) They avoid stack overflow issues

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

B) A relation involving only one previous term and a constant coefficient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

D) Both A and C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly