Q. Which of the following takes O(n) time in worst case in array implementation of stack?

  • (A) pop
  • (B) push
  • (C) isempty
  • (D) pop, push and isempty takes constant time
πŸ’¬ Discuss
βœ… Correct Answer: (D) pop, push and isempty takes constant time
Explanation: functions pop, push and isempty all are implemented in constant time in worst case.

Explanation by: Mr. Dubey
functions pop, push and isempty all are implemented in constant time in worst case.

πŸ’¬ Discussion

πŸ“Š Question Analytics

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