文档详情

基于二叉树遍历系统设计与实现设计____论文.doc

发布:2016-05-02约5.45千字共23页下载文档
文本预览下载声明
长春建筑学院《数据结构》课程设计(论文) 基于二叉树遍历系统设计与实现 Binary tree traversal System Design and Implementation 年 级: 学 号: 姓 名: 专 业: 指导老师: 二零一三年十二月 摘 要 针对现实世界中许多关系复杂的数据,如人类社会的家谱,各种社会组织机构,博弈交通等复杂事物或过程以及客观世界中广泛存在的具有分支关系或层次特性的对象.如操作系统的文件构成、人工智能和算法分析的模型表示以及数据库系统的信息组织形式等,用线性结构难以把其中的逻辑关系表达出来,必须借助于数和图这样的非线性结构,因此在以模拟客观世界问题,解决客观世界问题为主要任务的计算机领域中树型结构是信息的一种重要组织形式,树有着广泛应用。在树型结构的应用中又以二叉树最为常用。 二叉树是一种非常重要的非线性结构,所描述的数据有明显的层次关系,其中的每个元素只有一个前驱,二叉树是最为常用的数据结构,它的实际应用非常广泛,二叉树的遍历方式有三种,前序遍历,中序遍历,后序遍历,先序遍历的顺序为:NLR先根结点,然后左子树,右子树;中序遍历顺序为;LNR先左子树,然后根结点,右子树;后序遍历顺序为:LRN先左子树,然后右子树,根结点。由前序和中序遍历,有中序和后序遍历序列可以唯一确定一棵二叉树。 对于给几个数据的排序或在已知的几个数据中进行查找,二叉树均能提供一种十分有效的方法,比如在查找问题上,任何借助于比较法查找长度为Ⅳ的一个序表的算法,都可以表示成一株二叉树。反之,任何二叉树都对应一个查找有序表的有效方法根据树的数学理论,对于算法分析的某些最有启发性的应用,是与给出用于计算各种类型中不同树的数目的公式有关的。 本文对二叉树以及二叉树的各种功能做介绍以及写出一些基本的程序,让读者对二叉树的理解有更好的效果。 关键词:二叉树; 左子树; 右子树 Abstract In many real world of complex data, such as the human society family, social organization, widespread game traffic complex thing or process and the objective world with a branch or level characteristics of the object. If the operating system file analysis, artificial intelligence and algorithm model representation and database information system the form of organization, with a linear structure to express the logic relationship among them, must depend on the number and the diagram of such nonlinear structure, so in order to simulate the objective world, solve problems as the main task of the computer field in the tree structure is an important organization form of information, the tree has a broad application. In the application of tree structure in which the two fork tree is the most commonly used. Two binary tree is a kind of very important nonlinear structure, hiberarchy description of the data, where each element is only a precursor, two fork tree is the most commonly used data structure, its application is very extensive, there are three kinds of two binary tree traversal, preorder traversal, in the tra
显示全部
相似文档