[prev] [index] [next]

List Operations (cont)

An important operation used by list operations:
  • make a new node containing a specified value
Implementation:

NodeT *makeNode(int v) {
	NodeT *new;
	new = (NodeT *)malloc(sizeof(NodeT));
	assert(new != NULL);
	new->data = v;
	new->next = NULL;
	return new;
}