读书人

还有哪里不对改了半天,该如何处理

发布时间: 2012-06-11 17:42:22 作者: rapoo

还有哪里不对,改了半天

C/C++ code
[code=C/C++]//前序s.push(root);while(!s.empty()){root=s.top();visit(root);if(root->left)s.push(root->left);else         //将右子树搞进去{if(root->right)s.push(root->right);else        // 右子树为空,把根弹出s.pop();}}//中序s.push(root);while(!s.empty()){root=s.top();if(root->left)s.push(root->left);elsevisit(root);//右子树if(root->right)s.push(root->right);else{s.pop();}}//后序s.push(root);while(! s.empty()){root=s.top();if(root->left)s.push(root->left);if(root->right)s.push(root->right);else{visit(root);s.pop();}}}}



代码不长, 谢绝粘贴代码,我要代码的话,可以网上找,很多的

我想知道哪里错了,如何改进。

高手们帮忙看看,




[/code]

[解决办法]
探讨

晕, 那我的到底对不对啊,


郁闷死了

读书人网 >C语言

热点推荐