Exercise 4.2 (30 points)Create a stack with some data elements, and finish suchoperations as initialization, Push, Pop, etc.All operations should be implemented as independent functions,which can be called by the main function.(1) data elements, and end the process by entering -1, andoutput all the elements;(2) Get the length of the stack(3) Add a new data element into the stack;(4) Delete a data element from the stack, and output the datavalue
Expert Answer
An answer will be send to you shortly. . . . .