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 push(STACK *st,int element){ NODE *current =(NODE*) malloc(sizeof(NODE)); current->data = element; current->next = st->head; st->head = current; } int empty(STACK *st){ return st->head==NULL ?1:0; } int pop(STACK*st){ if(st->head==NULL){ printf("STACK underflow
"); return -1; } int store = st->head->data; NODE *temp = st->head; st->head = st->head->next; free(temp); return store; } int top(STACK *st){ if(st->head==NULL){ printf("STACK empty
"); return -1; } return st->head->data; } void sort_using_stack(int *arr,int n){ STACK main; STACK temp; main.head = temp.head = NULL; // changes for(int i=0;i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!