C语言版算法:试写一算法,统计单链表中的元素个数
int count(LinkList head) { int c = 0; LinkList p = head; while(p != NULL) { c++; p=p->next; } return c; }