We present a linked list method using dynamic memory allocation and pointers. The two structures needed to implement stacks are head structure and data node structure. We name them STACK and NODE, respectively. In C, they are defined as follows.
struct node
{
int data;
struct node *next;
};
struct stack
{
int count;
struct node *top;
}stack1;
No comments:
Post a Comment