25.2k views
5 votes
What runtime is needed to remove an element at the bottom of a stack with n elements and return the stack with all of the other elements in their original order?.

1 Answer

2 votes

Question: What runtime is needed to remove an element at the bottom of a stack with n elements and return the stack with all of the other elements in their original order?

Answer: O(n)

User Andreas Hunter
by
4.7k points