Can someone tell me how to implement a header node data structure?
Can someone tell me how to implement a header node data structure?
why do you need to impliment this? homework problem? then start by reading the relevant sections of the book. any other use? with linked lists and such, if you know why you need it, you usually know how to do it too.
hello, internet!
This is what I came up with, is there anything missing?
typedef struct
{
int num;
char name[20];
int qty;
} DATA;
typedef struct
{
int count;
struct nodeTag *pos;
} HEADER;
typedef struct nodeTag
{
DATA data;
struct nodeTag *back;
struct nodeTag *fore;
} NODE;
the HEADER needs to be defined after the NODE because when you define the HEADER it has no idea what a struct nodeTag; is
hello, internet!
Where do I put the link from the header node to the first node?
Define 'header node'? What is its purpose in comparison to other nodes? Is it just an anchor point for your list? If so, don't bother making it an actual node, just use a global node pointer.
struct Node *myList;
Otherwise, you need to clarify the issue. What exactly are you trying to do?
Quzah.
Hope is the first step on the road to disappointment.