[prev] [index] [next]

List Type (cont)

Common variations on basic List type ...

Store pointers to both first (head) and last (tail) nodes:

typedef struct { NodeT *head; NodeT *tail; } List;

Include a length counter:

typedef struct { NodeT *head; int length; } List;