home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_10
/
9n10024a
< prev
next >
Wrap
Text File
|
1991-08-14
|
837b
|
33 lines
/* --------------------------------------------------------------
FUNCTION DUMP_ASC_NODES: The steps to display all nodes in the list
in ascending order are:
A. Complain if list empty.
B. Traverse list starting at the root node displaying each node's
data.
-------------------------------------------------------------- */
void dump_asc_nodes(void)
{
Node *ptmp_node;
/*A*/ if (proot_node == NULL) {
printf("\n List contains no nodes\n");
return;
}
printf("\n List nodes are as follows:\n");
/*B*/ ptmp_node = proot_node;
while (ptmp_node != NULL) {
printf("\t%2u >%s<\n", ptmp_node->count,
ptmp_node->pstring);
ptmp_node = ptmp_node->pfwd;
}
}