登录
首页 » 数据结构 » 2.[问题描述] 编写递归算法,在二叉树中求位于先序序列中第K个位置的结点 [输入] 按照先序序列的顺序输入该结点的内容。其输入abd eh...

2.[问题描述] 编写递归算法,在二叉树中求位于先序序列中第K个位置的结点 [输入] 按照先序序列的顺序输入该结点的内容。其输入abd eh...

于 2022-06-02 发布 文件大小:6.93 kB
0 234
下载积分: 2 下载次数: 1

代码说明:

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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 学院管理体制
    在这些高校管理体系中包含各种搜索老师记录,学生记录,这样,轻松地访问任何信息等。
    2022-02-20 04:24:35下载
    积分:1
  • 一个较小的论坛程序本程序的基本功能是开放的讨论…
    一个小巧的论坛程序 本程序基本功能:  可开设任意数目的讨论区类别和版块 使用Cookies,方便用户的使用 用户有自定义的设置 帖子分表功能,大大的加快论坛的速度 用户自定义样式 投票功能,论坛短信功能,帖子置顶和总置顶功能 上传附件功能 锁定功能,包括锁定帖子功能和锁定论坛功能 认证功能,认证特殊用户 会员版面,仅注册用户登陆后才可进入...... 更多贴身功能相信您在使用过程中会感受得到-a smaller forum procedures of this program basic functions : to be open to discuss any number of category and the use of Cookies plate, the use of user-friendly user-defined settings posted meters function, and thus accelerate the pace of the Forum user-defined functions voting patterns, the Forum messaging functions, message home total set-top roof and functional upload attachments lock function, including articles lock function and lock forum function authentication, user authentication special Member layout, only registered users to enter only after landing ...... more personal function you believe in the use of the process will s
    2022-08-15 10:13:39下载
    积分:1
  • 图书管理系统
    这个源代码是一个图书管理系统,可以实现的功能有实现图书的增加删除。读者的新增添加删除。以及新增图书,借出图书图书超期管理。
    2022-01-30 16:25:57下载
    积分:1
  • 红黑树:输入:在同一目录下的redblacktree.txt文件中输入十个大于0的值,每个值中间用空格格开 目可以大于十个,但是要求在源程序中改变#def...
    红黑树:输入:在同一目录下的redblacktree.txt文件中输入十个大于0的数值,每个数值中间用空格格开 数目可以大于十个,但是要求在源程序中改变#define NUM 10 ,改成相应关键值各个数输出:按照先序输出红黑树,格式为:根节点。颜色(左子树。颜色,右子树。颜色),并输出此 树的黑高度,然后输入要删除的关键值,按回车后输出删除后的结果,并输出其高度。-RED-BLACK TREE : Admission : in the same directory under the file input redblacktree.txt greater than 0 10 digits each intermediate numerical grid with open spaces can be greater than the number 10, but requested change in the source# define NUM 10, the corresponding critical value into several different output : In accordance with the first sequence RED-BLACK TREE output format : nodes. Color (left subtree. Color, right subtrees. Color), and export of the black tree height and then delete the key to value, according to enter the output was the result of the deletion, and its high output.
    2022-06-11 22:41:49下载
    积分:1
  • 使用VC编写的栈的链式表示和实现程序,简单明了,方便使用
    使用VC编写的栈的链式表示和实现程序,简单明了,方便使用-Prepared using the VC stack chain expression and realization of program, simple and clear, easy to use
    2022-12-27 10:35:03下载
    积分:1
  • 最短路径的具体实现,使用了dikstra算法
    最短路径的具体实现,使用了dikstra算法-Concrete realization of the shortest path, using the algorithm dikstra
    2022-05-30 16:53:27下载
    积分:1
  • 一个带界面的在线测试系统,从库中随意抽题,在线回答,并且反馈答案。...
    一个带界面的在线测试系统,从数据库中随意抽题,在线回答,并且反馈答案。-An interface with the online testing system, arbitrarily drawn from the database title, on-line to answer, and the feedback answer.
    2023-03-08 07:50:04下载
    积分:1
  • 无限大整类 用链表实现无限大整的运算。 在进行大整运算时可以拿它当函,直接调用...
    无限大整数类 用链表实现无限大整数的运算。 在进行大整数运算时可以拿它当函数,直接调用-Infinite integer Class List realize infinite integer arithmetic. In large integer operations can use it as a function of the direct call
    2022-01-26 06:54:36下载
    积分:1
  • 一个效率可以的线段树代码 可以直接用来求解矩形面积并 另外可以修改实现更多功能....
    一个效率可以的线段树代码 可以直接用来求解矩形面积并 另外可以修改实现更多功能.-The efficiency of the line segment can be a tree code can be directly used to solve the rectangular area and the other can be modified to achieve more.
    2023-07-08 10:55:03下载
    积分:1
  • 电话计费管理系统 尽量不要让站长把时间都花费在为您修正说明...
    电话计费管理系统 尽量不要让站长把时间都花费在为您修正说明-TelephoneManage
    2022-03-02 03:27:23下载
    积分:1
  • 696516资源总数
  • 106611会员总数
  • 19今日下载