展开全部
int Len(Node *head)
{
Node *ps;
int count = 0;
ps = head;
if(ps == NULL)
return 0;
else
{
while(ps->next != head)
{
count++;
ps = ps->next;
}
return count;
}
}
{
Node *ps;
int count = 0;
ps = head;
if(ps == NULL)
return 0;
else
{
while(ps->next != head)
{
count++;
ps = ps->next;
}
return count;
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
int length(struct list * head)
{
int i = 0;
struct list *tmp;
if( head == NULL)
return 0;
if( head -> next == head)
return 1;
tmp = head->next;
while(
return i;
{
int i = 0;
struct list *tmp;
if( head == NULL)
return 0;
if( head -> next == head)
return 1;
tmp = head->next;
while(
return i;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
int length(struct list * head)
{
int i = 0;
struct list *tmp;
if( head == NULL)
return 0;
if( head -> next == head)
return 1;
tmp = head->next;
while(tmp != head)
{
i++;
tmp = tmp -> next;
}
return i;
}
{
int i = 0;
struct list *tmp;
if( head == NULL)
return 0;
if( head -> next == head)
return 1;
tmp = head->next;
while(tmp != head)
{
i++;
tmp = tmp -> next;
}
return i;
}
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询