Where did this 'specialized' idea of a head pointer come from? that's not how it's normally done.
Maybe you're confusing two separate issues-- linked lists and circular queues. 'Head' pointers aren't the same as 'root' node pointers, in conversation.
Both can have head and tail pointers, but usually it's implemented like this:
And for a linked list, like this:
For a circular queue:
. . .
/* Create 10 nodes as an array */
headPtr = &queue; /* init head */
tailPtr = &queue; /* init tail */
/* as data is added to the queue, the
* head pointer is incremented to the
* next element. If the head pointer
* pointer ever == the tail (swallows
* the tail), the queue is overrun/full
* The idea is that something else is
* following along, pulling data out of
* the tailptr and incrementing it so
* it tries to catch up (or run at the
* same rate) with the headptr. If
* the tail catches up to the head
* pointer, the queue is empty.
I mean, in terms of 'head pointers', usually that mechanism is used only when working with an array or an array of structures.
typedef struct nodeStruc
struct nodeStruc *next;
. . .
/* allocate 10 (or however many needed) nodes
* and link them together (or created and link them
* as needed
headPtr = nodeListP;
I hope this was not too far off what you were looking for.