1、 - 1 - 课程设计任务书课程设计任务书 题题 目目: : 二叉树的建立和遍历的演示(基于动二叉树的建立和遍历的演示(基于动态二叉链表)态二叉链表) 初始条件:初始条件: 理论:学习了数据结构课程,掌握了一种计算机高级语言。 实践:计算机技术系实验中心提供计算机及软件开发环境。 要求完成的主要任务要求完成的主要任务: : (包括课程设计工作量及其技术要求,以及说明书撰写 等具体要求) 1、系统应具备的功能: (1)建立二叉树的动态二叉链表存储结构 (2)用递归算法和非递归算法实现二叉树的各种遍历 (3)演示结果 2、数据结构设计; 3、主要算法设计; 4、编程及上机实现; 5、撰写课程设计报
2、告,包括: (1)设计题目; (2)摘要和关键字(中文和英文) ; (3)正文,包括引言、需求分析、数据结构设计、算法设计、有关技术 的讨论、设计体会等; (4)结束语; (5)参考文献。 时间安排:时间安排: 2011 年 1 月 10 日14 日 (第 19 周) 1 月 10 日 查阅资料 1 月 11 日 系统设计,数据结构设计,算法设计 1 月 12 日-13 日 编程并上机调试 1 月 14 日 撰写报告 1 月 15 日 验收程序,提交设计报告书。 指导教师签名:指导教师签名: 20112011 年年 1 1 月月 1010 日日 系主任 (系主任 (或责任教师) 签名:或责任教
3、师) 签名: 年年 月月 日日 - 2 - 二叉树的建立和遍历的演示二叉树的建立和遍历的演示 (基于动(基于动态二叉链表)态二叉链表) 摘 要: 二叉树是每个结点最多有两个子树的有序树。 通常节点的子树被称作“左 子树”(left subtree)和“右子树”(right subtree) 。遍历是对树的一种最基本的运 算,所谓遍历二叉树,就是按一定的规则和顺序走遍二叉树的所有结点,使每一 个结点都被访问一次,而且只被访问一次。由于二叉树是非线性结构,因此,树 的遍历实质上是将二叉树的各个结点转换成为一个线性序列来表示。 常用的遍历 方法有先序遍历、中序遍历和后续遍历,这三种遍历方法都可以通过
4、递归和非递 归算法实现。对于二叉树的三种遍历过程,如果用非递归算法来实现,则要复杂 一些。 Abstract:Abstract: Binary tree is an orderly tree that each node hava no more than two sub-trees. Subtree node is usually referred to as the “left sub-tree“ and “the right sub-tree“. Traversal of a tree is the most basic computing, the so-called binary t
5、ree traversal, that is, according to certain rules and order of every tree of all nodes and each node have been visited once. Binary tree structure as a result of non-linear, therefore, the tree is to traverse all tree nodes can converted into a linear sequence to express. Traversing methods commonl
6、y used in the first sequence traversal, traversing and subsequent traversal, all three kinds of traversal methods that can be realized through recursive and non recursive algorithm. For three binary tree traversal process, if you are using to implement non-recursive algorithms, it is more complex. 关键词:二叉树 遍历 递归 Key words: Binary tree traversal recursive - 3 - 1 1 引引 言言 在计算机科学中,二叉树是每个结点最多有两个子树的有序树。通常子树的 根被称作“左子树”(lef