Question: Plse solve fast 1 have hours Below is the Stack class which keeps a track of the minimum element in a stack data structure. The
Plse solve fast 1 have hours
Below is the Stack class which keeps a track of the minimum element in a stack data structure. The code includes some errors that prevent finding and keeping the minimum element added to the stack. You are expected to correct the errors. Just indicate here which line(s) of code you will correct and how. 1 class StackWithMin 2.1 3 stack int main; 4 stack int> min; 5 6 public: 7 7 void push(int x) 8 { 9 main.push(x); 10 if (main.size() - 1) 11 - { 12 min.pop(); 13 return; 14 3 15 16 if (*
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
