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.
3.8k
0
Do you find this helpful?
25

Discussion

No comments yet