119k views
2 votes
1. A problem can be solved recursively if it can be broken down into successive smaller problems that are unique within the overall problem.

a. True
b. False

2. It always is possible to replace a recursion by an iteration and vice versa.
a. True
b. False

3. A recursive method without a base case leads to infinite recursion.
a. True
b. False

4. Since iterative solutions often use loop variables and recursive solutions do not, the recursive solution is usually more memory efficient (uses less memory) than the equivalent iterative solution.
a. True
b. False

5. Some problems are easier to solve recursively than iteratively.
a. True
b. False

User The Moof
by
4.7k points

1 Answer

0 votes

Answer:

(1) True

(2) True

(3) True

(4) False

(5) True

Step-by-step explanation:

The essence of recursive function is to perform repetitive operation until the base case (or a condition) is met.

Using this analogy, we have

(1) True: The base case and other cases are instance of smaller units of a recursion. Hence, this option is true

(2) True: As explained earlier, recursions are used for repetitive operations (i.e. iteration); Hence, both can be used interchangeable

(3) True: The essence of the base case is to end the recursion. Without it, there will be an indefinite recursion

(4) False: This is false because recursions are not really memory efficient when compared to loops (e.g. for loops, while loops, etc.)

(5) True: This is sometimes true because at times it is better to solve a problem using recursions.

User Rakesh Chouhan
by
4.9k points