[prev] 75 [next]

Self-referential Structures

[Diagram:Pic/linkedList2.png]

Reminder: To realise a "chain of elements", need a node containing

  • a value
  • a link to the next node
In C, we can define such nodes as:

typedef struct node {
   int data;
   struct node *next;
} NodeT;