notes if stack-empty(sthen error "underflowelse top[ <top[ return [top[ the running time for the operations is ( (constant time implementation of stacks there are two basic methods for the implementation of stacks one where the memory is used statically and the other where the memory is used dynamically array-based implementation in this schemean array of certain maximum size is allocated memory statically ( once for allthe stack and its operations are implemented using this array the following pseudo-code shows the array-based implementation of stack in thisthe elements of the stack are of type struct stk array[max_size]/max_size is the maximum size *int top - /stack top initially given value - *stackvoid push( /*inserts an element into the stack *if (stack top =max_sizeprintf("stack is full-insertion not possible")else stack top stack top stack array[stack topet pop(/*returns the top element from the stack * xif(stack top =- printf("stack is empty")else stack array[stack top]stack top stack top lovely professional university