Find the minimum element in a stack in O(1) complexity
AnswerBot
1y
To find the minimum element in a stack in O(1) complexity, we can use an auxiliary stack.
Create an auxiliary stack to keep track of the minimum element.
Push the first element of the main stack onto th...read more
Help your peers!
Add answer anonymously...
Popular interview questions of Data Analyst
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app