二叉树遍历
来源:互联网 发布:管道应力分析软件 编辑:程序博客网 时间:2024/06/03 10:15
实质就是递归算法
先序遍历: public void preOrder(Bitree root)
{
if(root != null )
{
visit(root.date); //访问根节点
preOrder(root.lChild) ; //左子树
preOrder(root.rChild); //又子树
}
}
中序遍历:
public void inOrder(Bitree root)
{
if(root != null )
{
inOrder(root.lChild) ; //左子树
visit(root.date); //访问根节点
inOrder(root.rChild); //又子树
}
}
后续遍历;
public void postOrder(Bitree root)
{
if(root != null )
{
postOrder(root.lChild) ; //左子树
postOrder(root.rChild); //又子树
visit(root.date); //访问根节点
}
}
- 二叉树遍历、分层遍历
- 遍历二叉树--二叉树
- 【树】遍历二叉树
- 二叉树遍历
- 二叉树遍历
- 二叉树的遍历
- (原创)遍历二叉树
- 二叉树遍历-php
- 查找--遍历二叉树
- 遍历二叉树
- 二叉树遍历规则
- 二叉树的遍历
- 二叉树遍历
- 遍历二叉树
- 二叉树遍历问题
- 二叉树遍历
- 二叉树遍历(zz)
- 二叉树的遍历
- 2.6内核中likely()与unlikely()解析
- 99个网页模板
- 百度地图API之POI搜索-发现你身边的兴趣点,如超市、餐厅、ATM...(Android)
- hibernate相关收集
- Android 控件的各种方法介绍
- 二叉树遍历
- 创业如何选择WEB开发语言
- __super in MFC
- iphone ios 文件系统操作(创建、删除,修改,获取属性)
- SVN客户端基本使用方法
- EMC针对VMware的云计算集成基础架构和VDI解决方案 在线研讨会 网友问答实录
- Tortoise SVN 版本控制常用操作知识
- 统计英文文章单词JAVA代码
- linux内核中Kconfig文档的作用