Q.

What is the time complexity of the program to reverse stack when linked list is used for its implementation?

A. o(n)
B. o(n log n)
C. o(n2)
D. o(log n)
Answer» A. o(n)
Explanation: as a linked list takes o(n) time for getting reversed thus linked list version of stack will also take the same time.
1.4k
0
Do you find this helpful?
1

Discussion

No comments yet