当前位置:网站首页>Tree, forest and transformation of binary tree
Tree, forest and transformation of binary tree
2022-06-22 19:56:00 【Just one word】
1. Convert normal tree to binary tree

Add lines , Add a connection between all brother nodes .

Off line , For every node in the tree , Only the connection between it and the first child node , Delete the connection between it and other child nodes .

Level adjustment , Take the root node of the tree as the axis , Turn the whole tree clockwise for a certain angle , Make it structured

2. The forest is converted into a binary tree
Convert each tree into a binary tree .
The first binary tree doesn't move , Start with the second tree , Take the root node of the last binary tree as the right child of the root node of the previous binary tree , Connect with wires .
3. Binary trees transform into forests 、 Common tree
Judge whether a binary tree can be converted into a tree or a forest , The standard is simple , That is, just look at whether the root node of this binary tree has a right child , Some are forests , If there is no tree, it is an ordinary tree .



边栏推荐
- 卡尔加里大学|基于强化学习的推荐系统综述
- 【深入理解TcaplusDB技術】TcaplusDB運維——日常巡檢
- Quick indent usage in VIM
- 使用 Order by 与 rownum SQL 优化案例一则
- 北京大学|通过对比学习实现离线元强化学习的鲁棒任务表示
- 技术管理进阶——你了解成长的全貌吗?
- Mini web framework: template replacement and routing list function development | dark horse programmer
- Install some office tools
- Follow up course supplement of little turtle teacher "take you to learn C and take you to fly"
- 1.2-----机械设计工具(CAD软件)和硬件设计工具(EDA软件)及对比
猜你喜欢

0816 shortcomings of Feida (improvement direction)

Wavelet transform DB4 for four layer decomposition and signal reconstruction matlab analysis and C language implementation

记可视化项目代码设计的心路历程以及理解

图的定义及术语

1.3-----Simplify 3D切片软件简单设置

小甲鱼老师《带你学C带你飞》的后续课程补充

二叉排序树的查找、插入和删除

Initial experience of ABAQUS using RSG drawing plug-in

0.1-----用AD画PCB的流程

Openpnp调试 ------ 0816飞达推0402编带
随机推荐
华为云招募工业智能领域合作伙伴,强力扶持+商业变现
B树代码(C语言)
产品几何技术规范(GPS) 线性尺寸公差ISO代号体系
lua--迭代器、模块、元表
在线生成占位图片
Ts as const
Follow up course supplement of little turtle teacher "take you to learn C and take you to fly"
1.3-----Simplify 3D切片软件简单设置
Calendar control programming
树、森林及二叉树的相互转换
3D打印机耗材受潮
DIV横向布局
哈夫曼树(C语言)
Methods for converting one-dimensional data (sequence) into two-dimensional data (image) GAFS, MTF, recurrence plot, STFT
Fault analysis | from data_ Free exception
Online generation of placeholder pictures
Some problem records of openpnp using process
84.(cesium篇)cesium模型在地形上运动
libcef最新下载地址-在VS2015下编译为MD-动态链接
如何在 FlowUs和Notion 等笔记软件中进行任务管理?