Now that we have the required data structures defined, we can declare operations on those data structures. A data structure is defined by both the data it contains or represents and the operations that can be performed on it. The operations we will need to perform in order to manipulate a general linked list mechanism independently of the specific data contents of the list are as follows:
- Create a new LinkedList header that allocates and properly initializes the header record.
- Create a new ListNode element that allocates and properly initializes the node element. Once created, the node still isn't part of the list.
- Deletea node. This doesn't involve the list; typically, this will be done after a node is removed from the list.
- Insert a node either into the front or back of the list.
- Remove a node either from the front or back of the list and return that node to the caller...