![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
c04p219.cppGo to the documentation of this file.00001 00016 // display the data in a circular linked list; 00017 // list points to its last node 00018 if (list != NULL) 00019 { // list is not empty 00020 Node *first = list->next; // point to first node 00021 00022 Node *cur = first; // start at first node 00023 // Loop invariant: cur points to next node to 00024 // display 00025 do 00026 { display(cur->item); // write data portion 00027 cur = cur->next; // point to next node 00028 } while (cur != first); // list traversed? 00029 } // end if |