Question: 1. Given the following declaration class stack f private: int elt[5]; int counter public: void CreateStack0&counter 0;) void IsEmpty0 fif( counter0) return true; else return
1. Given the following declaration class stack f private: int elt[5]; int counter public: void CreateStack0&counter 0;) void IsEmpty0 fif( counter0) return true; else return false; ) void IsFull() f if ( counter5) return true; else return false; void push(int x ) { elt[counter] x; counter ++;} int pop() f int x; x elt[counter -1 ]: --counter; ) (5 points) We want to change the above class declaration to a template class to have a control on the size and the type of elements in the stack...Cross out the changes you want to make and write the new changes. a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
