The linked list dynamic data structure
The most basic dynamic data structure is the linked list. A linked list is the basis for other dynamic structures, such as stacks, queues, and deques. A stack conforms to the rules that each new element must be added to the front of the list, and that each element can only be removed from the front of the list. A queue conforms to the rules that each new element must be added to the back of the list, and that each element can only be removed from the front of the list. A deque is a generalized form of both a stack and queue and has the operations of both of them.
We will implement a simple linked list and then test it from within the main()
function. Later, we will employ this list structure and its routines when we return to our carddeck.c
program in Chapter 24, Working with Multi-File Programs.
Create a file called linklisttester.c.
It is in this single file that we will create our linked list structure, operations...