I am trying to use this struct, and adding an item at the beginning of a list.Code:typedef struct NodeTag { char Letter; struct NodeTag *Link; } NodeType;
the + = null (end of the list)Code:L -> | B | |-> | C | +|
L points to the list. B and C are the (char Letter), and the second block is the pointer.
so this is what I have for the insert function at the beginning
Is that right?Code:InsertNode(A, &L) { if(Empty(L)) L = A; else A = L; L = A; }
Thanks