A Linked List implimentation in C.
With a small library of functions for manipulating lists.
Example of use in main.c
.
parameters: int d
returns: struct Node *
description: allocates memory for a struct Node
on the heap and returns a struct Node *
to it
parameters: struct Node *root
, struct Node *n
returns: int
description: appends struct Node *n
to the end of list struct Node *root
parameters: struct Node *root
returns: struct Node *
or NULL
description: removes and returns the last struct Node *
in list struct Node *root
or NULL
if root
was empty or NULL
parameters: struct Node *root
returns: int
description: returns the number of nodes in list struct Node *root
, or -1
if root
is NULL
parameters: struct Node *root
, int index
returns: struct Node *root
or NULL
description: removes the node at int index
of struct Node *root
by linking the previous node to the next node, returns the removed node if or NULL
if it could not be found
parameters: struct Node *root
, int index
returns: struct Node *root
or NULL
description: returns the node at int index
of struct Node *root
or NULL
if it could not be found