The last Node of Link List

来源:互联网 发布:淘宝怎样做会员制度 编辑:程序博客网 时间:2024/05/06 13:54

The Last node should pointer to itself, as following:

     Node *z = new Node;

     z->Next = z;

That could display the records N rather than N+1.

The display condition should be written as:

     while( t!=t->next )
     {
       // do something
      //  ......
      }

 

原创粉丝点击