Singly Linked List

Author: Mikhail Jacques
Student ID: 0128039
Date: July 12, 2001
Place: Computer Science Department, Trent University, Ontario, Canada

This program shows the implementation of Abstract Data Type (ADT) lists by using pointers.
A general list or ordered list with a set of elements (of any type), where there
exists a linear relationship among the elements is called an ADT list.
- Each element (with an exception of the first and the last) has a unique predecessor
and a unique successor.
- Each element, therefore, has a unique position: the position of the first element
is 0, the position of the second is 1, ..., and the position of the last is n - 1.
- Linear relationship is represented by the order of the elements in the list.

Pointers refer to memory locations. A pointer is not the name of a memory location
containing a data item (i.e. variable), but rather the name of a memory location
containing the address of a location containing the data item.
Pointers facilitate the design and the usage of dynamic data structures - structures
that can expand and contract during the runtime of the program.
A pointer implementation of a list is called a linked list. Linked implementations
of lists are not as conceptually simple as arrays, but more efficient to implement.

This program uses a singly-linked list - each node has only one pointer that
points to the next node. The disadvantage of this method is that it makes
insertions and deletions more difficult because we do not have access to the
previous node.