- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
二叉树的四种遍历方法和两种求深度的方法(国外英文资料)
二叉树的四种遍历方法和两种求深度的方法(国外英文资料)
Four of the two fork tree traversal method and two methods for the depth of.Txt and the mood of aftershocks, like the first love lover girl, afraid he does not come, and feared him. I heard The woman is like the clothes, Brothers are like hands and feet., in retrospect, I actually all flurry and confusion streaking more than 20 year! Im in a bad mood today. I only have four sentences to say, including this sentence and the first two sentences! Four traversal methods of two trees and two methods for finding depth
Using the previous knowledge of the stack and queue, is also a kind of review. However, when you use the stack for depth, you change the two fork tree, and you dont know how to avoid it
Two / tree.Cpp: entrance point console application.
#include stdafx.h
#include stdio.h
#include stdlib.h
Typedef struct BiTNode{/ / two tree structure
Int data;
Struct, BiTNode, *lchild, *rchild;
}BiTNode, *BiTree;
#define STACK_INIT_SIZE 100
#define STACKINGMENT 10
Int CreateBiTree (BiTNode **T) / / first order in order to establish the two fork tree
{
Char c;
If ((c) = getchar () =#)
*T = NULL;
Else
{
If (= *T = (BiTree) malloc (sizeof (BiTNode)))
{
Printf (ERROR!);
Return 0;
}
(*T) -data = c;
CreateBiTree ( (*T) -lchild);
CreateBiTree ( (*T) -rchild);
}
Return 0;
}
Int PrintfElement (int E)
{
Printf (%c, e);
Return 1;
}
Int PreOrderTraverse (BiTree T, int (* PrintfElement) (int E)) / / recursive method of preorder traversal of binary tree two
{
If (T) / access node
{
If (PrintfElement (T-data))
If (PreOrderTraverse (T-lchild, PrintfElement)) / / the first traversal of the left subtree
If (PreOrderTraverse (T-rchild, PrintfElement)) / / the first traversal of the right subtree
Return 1;
Return 0;
}
Else
Return 1;
}
Int InOrderTraverse (BiTree T, int (*PrintfElement) (int)) / / recursive method in order traversal binary tree two
{
If (T)
{
If (InOrderTraverse (T-lchild, PrintfElement))
If (PrintfElement (T-data))
If (InOrderTraverse (T-rchild, Pri
您可能关注的文档
- ye 沙巴亚庇之行-美食篇(国外英文资料).doc
- ZWCAD 常用命令(国外英文资料).doc
- z绞股蓝(国外英文资料).doc
- [[高三化学教案]]2010年高考风向标第五部分化学反应原理第22讲《弱...(国外英文资料).doc
- [参考资料] 时装画概论(国外英文资料).doc
- [分享]按功率计算电流的口诀(国外英文资料).doc
- [创业]领导者之远见与决断力(国外英文资料).doc
- [听力指导] 品质Quality(国外英文资料).doc
- [工具类] 中文验证 [java交流Q群12375544]jsp(国外英文资料).doc
- [综合] 2013年司法测验师长教师及教材推荐(必威体育精装版)(国外英文资料).doc
文档评论(0)