正在加载图片...
public int ListLengtho int n=0 LinkList p; p=head; /p指向头结点,n置为0即头结点的序号为 while(p. next!=null) n++ p-p next: return n; 循环结束,p指向尾结点,其序号m为结点个数public int ListLength() { int n=0; LinkList p; p=head; //p指向头结点,n置为0(即头结点的序号为0) while (p.next!=null) { n++; p=p.next; } return n; //循环结束,p指向尾结点,其序号n为结点个数 }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有