文件名称:Create_and_bianli_BiTree
介绍说明--下载内容均来自于网络,请自行研究使用
c语言实现的
算法思想:
根据完全二叉树的定义,对完全二叉树按照从上到下,从左到右的层次序遍历应该满足:
(1)某节点没有左孩子,则一定无右孩子
(2)某节点缺左或右孩子,则其所有后继一定无孩子。
若不满足上述任何一条,均不为完全二叉树。
(3) 利用栈先序遍历
-c language implementation of the algorithm is thinking: According to the definition of complete binary tree, according to the complete binary tree from top to bottom, left to right preorder traversal of the hierarchy should be satisfied: (1) a node, there is no left child, then certainly no right-child (2) a shortage of left or right child nodes, then all its successors will no children. If not meet any of the above one, are not as complete binary tree. (3) the use of the stack preorder traversal
算法思想:
根据完全二叉树的定义,对完全二叉树按照从上到下,从左到右的层次序遍历应该满足:
(1)某节点没有左孩子,则一定无右孩子
(2)某节点缺左或右孩子,则其所有后继一定无孩子。
若不满足上述任何一条,均不为完全二叉树。
(3) 利用栈先序遍历
-c language implementation of the algorithm is thinking: According to the definition of complete binary tree, according to the complete binary tree from top to bottom, left to right preorder traversal of the hierarchy should be satisfied: (1) a node, there is no left child, then certainly no right-child (2) a shortage of left or right child nodes, then all its successors will no children. If not meet any of the above one, are not as complete binary tree. (3) the use of the stack preorder traversal
(系统自动生成,下载前可以参看下载内容)
下载文件列表
实验二二叉树.doc