McqMate
| 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. | |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet