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)
πŸ’¬ Discuss
βœ… Correct 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.

Explanation by: Mr. Dubey
as a linked list takes o(n) time for getting reversed thus linked list version of stack will also take the same time.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
148
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate