Linked Lists Review

So here's a node similar to what you may have seen in lecture. The data section of the nodes can be as simple as a single int, or as complex as an entire struct. The head pointer allows you to access the first node in the linked list to perform various operations on the list.

Using a Head Structure with a Linked List

A head structure keeps this pointer to the head, plus some more useful information about the entire list, such as:

Here is what the Head structure in our lab will look like:

The code for declaring such a structure looks like this:

typdef struct headStructure { int numNodes; /* number of nodes in the list */ int classSum; /* sum of grades in the entire list */ NODEPTR head; /* will point to the start of the list */ } HEADSTRUCTURE;

In Summary

Now you are ready to begin the lab. Go to Step 0