
136 Introduction to Computational Modeling
FIGURE 10.3: A new node inserted in the front of a linked list.
FIGURE 10.4: A new node inserted after node 2.
main, which appears on lines 20 to 62 calls these functions to create and manipulate
a linked list. The C source code of this program is stored in file datablistp.c.
The C files that define the linked list structures and the function definitions are stored
in linked.h and linked.c.
Listing 10.1: C program for creating and manipulating a linked list.
1 /
*
Program: datablistp.c
2 This program shows how to create nodes and various ways
3 to link them in a linked list using data blocks.
4 The linked list is