Question: #include #include / / changes typedef struct node { int data; struct node * next; } NODE; typedef struct stack { NODE * head; }
#include #include changes typedef struct node int data; struct node next; NODE; typedef struct stack NODE head; STACK; void pushSTACK stint element NODE current NODE mallocsizeofNODE; currentdata element; currentnext sthead; sthead current; int emptySTACK st return stheadNULL :; int popSTACKst ifstheadNULL printfSTACK underflow
; return ; int store stheaddata; NODE temp sthead; sthead stheadnext; freetemp; return store; int topSTACK st ifstheadNULL printfSTACK empty
; return ; return stheaddata; void sortusingstackint arrint n STACK main; STACK temp; main.head temp.head NULL; changes forint i;i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
