notes /pops off the items from the stack *int popint data if pos =- printf "\nstack is emptyreturn - else data stackpos pos-return data in this program stack is implemented and maintained using linked list this implementation is more sophisticated compared to the one that uses an arraythe added advantage being we can push as many elements as we want new node is created by push(using malloc)every time an element is pushed in the stack each node in the linked list contains two membersdata holding the data and link holding the address of the next node the end of the stack is identified by the node holding null in its link part the popfunction pops out the last element inserted in the stack and frees the memory allocated to hold it stack_displaydisplays all the elements that stack holds countcounts and returns the number of elements present in the stack #include "alloc hstruct node int data struct node *link push struct node **int pop struct node *mainstruct node *top /top will always point to top of stack *int itemtop null /empty stack *push &top push &top push &top push &top push &top lovely professional university