[prev] [index] [next]

Self-referential Structures

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:

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