-
2.[问题描述]
编写递归算法,在二叉树中求位于先序序列中第K个位置的结点
[输入]
按照先序序列的顺序输入该结点的内容。其输入abd eh...
2.[问题描述]
编写递归算法,在二叉树中求位于先序序列中第K个位置的结点
[输入]
按照先序序列的顺序输入该结点的内容。其输入abd eh cf i g 。输入要求的位置
[输出]
若二叉树不空,按先序序列输出,求出所求位置的结点
[存储结构]
采用二叉表存储
[算法的基本思想]
采用递归方法建立和遍历二叉树。首先建立二叉树的根结点,然后建立其左右子树,直到空子树为止,先序遍历二叉树时,先遍厉左子树,后遍厉右子树,最后访问根结点并计算出二叉树中叶子结点的数目和第K个位置的结点
#include
#include
struct node{
char info
struct node*llink,*rlink
}
typedef struct node NODE
-2. [Description of the issue] to prepare recursive algorithm, Binary for the first sequence sequence in the first position of the K-node [imported] in accordance with the first order input sequence in the order of the nodes content. Input abd eh i g cf. Import requirements of the position [output] if the binary tree is not empty, the first sequence by sequence output obtained by seeking the location of nodes [storage structure] Table 2 forks storage [algorithm for the basic idea] recursive method and Traversing binary tree. First established binary tree root node, and then to build t
- 2022-06-02 16:30:44下载
- 积分:1
-
用内嵌法求多项式
用内嵌法求多项式-with embedded Polynomial Method
- 2022-11-12 06:55:03下载
- 积分:1
-
相当不错 最新的
相当不错 最新的-quite the latest
- 2022-03-12 02:34:19下载
- 积分:1
-
data structure
数据结构-二叉树-data structure-Binary Tree
- 2022-09-08 23:40:03下载
- 积分:1
-
数据结构的课后练习
数据结构的课后练习-Data structure of the after-school practice
- 2022-10-19 13:00:03下载
- 积分:1
-
good sql Manual
很好的sql手册-good sql Manual
- 2023-02-24 21:20:04下载
- 积分:1
-
网络流算法的程序以及用网络流解决两个最小割模型的代码
网络流算法的程序以及用网络流解决两个最小割模型的代码-Network flow algorithm for the procedure as well as network flow solution to the two minimal cut model code
- 2022-09-02 09:45:03下载
- 积分:1
-
推荐关于数学建模的电子书,非常有用,里面包括数据结构等等。...
推荐关于数学建模的电子书,非常有用,里面包括数据结构等等。-Recommended on the mathematical modeling of e-books, very useful, which includes data structures and so on.
- 2022-07-16 15:01:30下载
- 积分:1
-
excel仪表盘,很强大的仪表盘功能,做得很漂亮
excel仪表盘,很强大的仪表盘功能,做得很漂亮-excel
- 2022-09-30 22:15:03下载
- 积分:1
-
script for apotec sofware (visual basic 6.0)
script for apotec sofware (visual basic 6.0)
- 2022-08-09 08:08:29下载
- 积分:1