McqMate
| Q. |
Which of the following implementations of Catalan numbers has the smallest time complexity? |
| A. | dynamic programming |
| B. | binomial coefficients |
| C. | recursion |
| D. | all have equal time complexity |
| Answer» B. binomial coefficients | |
|
Explanation: The time complexities are as follows: Dynamic programming: O(n2) Recursion: Exponential Binomial coefficients: O(n). |
|
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet