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). |

4.4k

0

Do you find this helpful?

1

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- Which of the following is NOT a Catalan number?
- Which of the following methods can be used to find the nth Catalan number?
- Which of the following sorting algorithm has best case time complexity of O(n2)?
- Which of the following is true about the time complexity of the recursive solution of the subset sum problem?
- Which of the following is true about the time complexity of the recursive solution of set partition problem?
- Consider the brute force implementation of the rod cutting problem in which all the possible cuts are found and the maximum value is calculated. What is the time complexity of this brute force implementation?
- Consider the brute force implementation in which we find all the possible ways of multiplying the given set of n matrices. What is the time complexity of this implementation?
- What is the time complexity of the above code used to reverse a string?
- What is the time complexity of the above recursive implementation used to reverse a string?
- What is the time complexity of matrix multiplied recursively by Divide and Conquer Method?