Quiz Question 1 of 5
Given a recursive solution to the Three Towers problem, how does the time complexity compare to an iterative solution, and why might a recursive solution still be preferred?
Choose the correct answer below:
-
A
The iterative solution has better time complexity, but recursion is necessary for problems involving multiple smaller subproblems.
-
B
The time complexity of both recursive and iterative solutions is the same, but recursion is easier to implement.
-
C
The recursive solution has better time complexity due to fewer base cases being evaluated.
-
D
The time complexity of the recursive solution is worse, but recursion allows for more elegant code and easier problem breakdown.