home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_10 / 9n10024b < prev    next >
Text File  |  1991-08-14  |  838b  |  33 lines

  1.  
  2. /* --------------------------------------------------------------
  3.  
  4. FUNCTION DUMP_DES_NODES: The steps to display all nodes in the list
  5.         in descending order are:
  6.  
  7. A.  Complain if list empty.
  8.  
  9. B.  Traverse list starting at the tail node displaying each node's
  10.     data.
  11.  
  12. -------------------------------------------------------------- */
  13.  
  14. void dump_des_nodes(void)
  15. {
  16.         Node *ptmp_node;
  17.  
  18. /*A*/   if (proot_node == NULL) {
  19.                 printf("\n   List contains no nodes\n");
  20.                 return;
  21.         }
  22.  
  23.         printf("\n   List nodes are as follows:\n");
  24.  
  25. /*A*/   ptmp_node = ptail_node;
  26.         while (ptmp_node != NULL) {
  27.                 printf("\t%2u >%s<\n", ptmp_node->count,
  28.                         ptmp_node->pstring);
  29.                 ptmp_node = ptmp_node->pbwd;
  30.         }
  31. }
  32.  
  33.