登录
首页 » 算法 » 按层打印二叉树

按层打印二叉树

于 2022-04-18 发布 文件大小:161.54 kB
0 211
下载积分: 2 下载次数: 1

代码说明:

算法思想: 先把根结点入队,然后循环直到队列为空:出队一个结点,打印之,将其邻接点依次入队;打印和入队邻接点前要先判断是否已经打印过了,如果已打印过的就不操作 。                                                                 此算法是在visual studio2012平台下实现二叉树的层次遍历,程序需要先输入二叉树,然后会将此二叉树按曾打印

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

发表评论

0 个回复

  • 天气决策树源代码
    用Information Gain构造决策树的方法。 计算各分支的熵 “晴”的分支含2个正例3个反例,所需期望信息量为:         M(天况为晴)=-2/5 * log2 (2/5)-3/5 * log2 (3/5)                                 = 0. 971 bits “多云”的分支,含4个正例0个反例:          M(天况为多云)=0  “雨”的分支,含3个正例2个反例:           M(天况为雨)=-3/5 * log2 (3/5)-2/5 * log2 (2/5)     
    2023-03-06 04:15:04下载
    积分:1
  • largreance插值 迭代法 迭代改善法
    largreance插值 迭代法 迭代改善法-largreance interpolation Iterative Improvement Act
    2022-09-26 12:55:02下载
    积分:1
  • 这个类提供了一组函数接口声卡输入…
    The SoundIn class provide a set of functions to interface a sound card for input signal. -SoundIn provide a set of function "s to a sound card interface for input signal.
    2022-08-20 13:27:24下载
    积分:1
  • 6 自由度的机器人手臂的模拟
    这个程序演示了如何模拟和容易画用 matlab 编写了一个移动的机制。此代码显示移动他的手,沿着螺旋的 6 自由度机器人手臂。
    2023-03-26 09:25:03下载
    积分:1
  • 自己编写的,背包问题的各种近似算法以及动态规划算法,请多多指教...
    自己编写的,背包问题的各种近似算法以及动态规划算法,请多多指教-I have written, knapsack problem, as well as a variety of approximate dynamic programming algorithm algorithm, please advice
    2023-07-22 05:35:03下载
    积分:1
  • Monte Carlo method known as random or statistical skills test method. More than...
    蒙特卡罗方法又称随机抽样技巧或统计试验方法。半个多世纪以来,由于科学技术的发展和电子计算机的发明 ,这种方法作为一种独立的方法被提出来,并首先在核武器的试验与研制中得到了应用。蒙特卡罗方法是一种计算方法,但与一般数值计算方法有很大区别。它是以概率统计理论为基础的一种方法。由于蒙特卡罗方法能够比较逼真地描述事物的特点及物理实验过程,解决一些数值方法难以解决的问题,因而该方法的应用领域日趋广泛。 -Monte Carlo method known as random or statistical skills test method. More than half a century, the development of science and technology and the invention of the electronic computer, this method as an independent method was raised and the first nuclear test and research has been applied. The Monte Carlo method is a calculated, but with the general numerical method a great difference. It was based on the theory of probability and statistics-based approach. As the Monte Carlo method can vividly describe things and the physical characteristics of the experimental process, numerical methods to solve some difficult problems, the result of the increasingly extensive application areas.
    2022-07-14 13:23:24下载
    积分:1
  • Canny edge detector algorithm matlab
    这部分给出了
    2022-02-02 18:53:09下载
    积分:1
  • 智商商测试软件 VB
    智商商测试软件 VB-IQ test software VB
    2022-03-17 08:46:18下载
    积分:1
  • 机械原理课程设计,牛头刨床的动力学分析,及动画演示。
    机械原理课程设计,牛头刨床的动力学分析,及动画演示。-mechanical principles to the curriculum design, Shaper of the kinetic analysis, and animation demo.
    2022-04-25 11:15:08下载
    积分:1
  • 等值线原码中插值算法,还可以吧。如有问题给我发EMAIL.
    等值线原码中插值算法,还可以吧。如有问题给我发EMAIL.-contours original codes interpolation algorithm, it can. If problems given me a email.
    2022-10-12 05:30:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载