data structures using peek operation peek is an operation that returns the value of the topmost element of the stack without deleting it from the stack the algorithm for peek operation is given in fig howeverthe peek operation first checks if the stack is emptyi if top nullthen an appropriate message is printedelse the value is returned consider the stack given in fig step if top null print "stack is emptygoto step step return stack[topstep end figure algorithm for peek operation top figure stack herethe peek operation will return as it is the value of the topmost element of the stack programming example write program to perform pushpopand peek operations on stack #include #include #include #define max /altering this value changes size of stack created int st[max]top=- void push(int st[]int val)int pop(int st[])int peek(int st[])void display(int st[])int main(int argcchar *argv[]int valoptiondo printf("\ *****main menu*****")printf("\ push")printf("\ pop")printf("\ peek")printf("\ display")printf("\ exit")printf("\ enter your option")scanf("% "&option)switch(optioncase printf("\ enter the number to be pushed on stack")scanf("% "&val)push(stval)breakcase val pop(st)if(val !- printf("\ the value deleted from stack is% "val)breakcase val peek(st)if(val !-