结构推理
写一个算法,返回链栈中结点的个数。
【正确答案】
int StackLength(LINKSTACK*top)
{ int len=0;
LINKSTACK*p=top;
if(p)
{ len++;
p=p->next;}
return len;
}
【答案解析】
提交答案
关闭