- Computer Science Engineering (CSE)
- Design and Analysis of Algorithms
- What is the space complexity of program ...

Q. |
## What is the space complexity of program to reverse stack recursively? |

A. | o(1) |

B. | o(log n) |

C. | o(n) |

D. | o(n log n) |

Answer» C. o(n) | |

Explanation: the recursive program to reverse stack uses memory of the order n to store function call stack. |

View all MCQs in:
Design and Analysis of Algorithms

- What will be the time complexity of the code to reverse stack recursively?
- What is the time complexity of the program to reverse stack when linked list is used for its implementation?
- What is the time complexity of matrix multiplied recursively by Divide and Conquer Method?
- Which of the following is considered as the top of the stack in the linked list implementation of the stack?
- 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?
- Stack can be reversed without using extra space by
- Matrix A is of order 3*4 and Matrix B is of order 4*5. How many elements will be there in a matrix A*B multiplied recursively.
- What is the auxiliary space complexity of Z algorithm for pattern searching (m = length of text, n = length of pattern)?
- What is the space complexity of the recursive implementation used to find the nth fibonacci term?

Login to Continue

It will take less than 2 minutes

Report MCQ