In this sub-project, you will implement one class:
A stack stores elements in an ordered list and allows insertions and deletions at one end of the list in O(1) time.
The elements in this stack are stored in an array. The size of the array may be changed depending on the number of elements currently stored in the array, according to the following two rules:
The amortized run time of each member function is specified in parentheses at the end of the description.
A class which implements a stack using an array. The size of the array may be changed dynamically after insertions or deletions. For run-time requirements, the number of elements in the stack is n.
The class at least four members:
Dyanamic_stack( int n = 10 )
The constructor takes as an argument the initial size of the array and allocates memory for that array. The default number of entries is 10. Other class members are assigned as appropriate.
~Dyanamic_stack()
The destructor deletes the memory allocated for the array.
This class has four accessors:
This class has three mutators:
The class has no friends.