默认头像
外卖仔
外卖仔
  • 注册日期2006-03-18
  • 发帖数74
  • QQ
  • 铜币322枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2506回复:0

[求助]怎么做?

楼主#
更多 发布于:2006-12-29 19:21

1.        说出算法输出的结果

void main( )

{

Stack S;

Char x,y;

InitStack(S);

X=’a’;y=’b’;

Push(S,x); Push(S,’c’);  Push(S,y);

Pop(S,x); Push(S,’e’); Push(S,x);

Pop(S,x); Push(S,’q’);

while(!StackEmpty(S)){ Pop(S,y);printf(“%c  ”,y); };

printf(“%c\n”,x);

}

1.    说出下列算法的功能。

int depth(BTreeNode * root)      

{

int d,  p;                    

p=0;

if(root==NULL)  return(p);      

else{

d=depth(root->left);

if(d>p) p=d;              

d=depth(root->right);

if(d>p)p=d;

}

p=p+1;

return(p);

}

喜欢0 评分0
如果有一天,当我真的离开你, 当你的心真的在痛,眼泪快要流下来的时候, 那就赶快抬起头,看看这片曾经属于我们的天空, 天依旧是那么的广阔,云依旧是那么的潇洒, 那就不应该哭,因为我的离去,并没有带走你的世界!
默认头像

返回顶部