Question: C language Suppose we have a stack implemented as a linked list. The stack is considered full if it has 10 nodes and empty if

C language

Suppose we have a stack implemented as a linked list. The stack is considered full if it has 10 nodes

and empty if the head pointer is NULL. The nodes of the stack have the following structure;

typedef struct nod {

int info;

struct nod *next;

} node;

Write a function to determine if the status of the stack. It returns -1 if it is empty, 1 if it is full, and 0 if it is neither empty nor full .The function is called with the root node pointer as an argument.

int stackStatusl(node *stack) {

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 Databases Questions!