Write a C program using stack to perform the following operations: (i) void push(int x); (ii) void pop(); perform pop operation and multiply it by 10 and again push onto the stack
Answers
Answered by
0
Consider the following SpecialStack
16 --> TOP
15
29
19
18
When getMin() is called it should
return 15, which is the minimum
element in the current stack.
If we do pop two times on stack,
the stack becomes
29 --> TOP
19
18
When getMin() is called, it should
return 18 which is the minimum in
the current stack.
Similar questions