当前位置:网站首页>Chain storage of binary tree
Chain storage of binary tree
2022-07-01 12:23:00 【Between the steps】
The sequential storage of binary tree is only suitable for complete binary tree and full binary tree , Chain storage is suitable for other ..
#include<stdio.h>
struct ElemType{
int data;
};
typedef struct BiTNode{
ElemType data;
struct BiTNode *lchild,*rchild; // Some may be added *parents Trident linked list
}BiTNode,*Bitree;
// Define an empty tree
Bitree root=NULL;
// Insert root
root=(Bitree)malloc(sizeof(BiTNode));
root->data={
1};
root->lchild=NULL;
root->rchild=NULL;
// Insert new node
BiTNode *p=(BiTNode*)malloc(sizeof(BiTNode));
p->data={
2};
p->lchild=NULL;
p->rchild==NULL;
root->lchild=p; // The left child as the root node
边栏推荐
- [Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 6
- 91. (cesium chapter) cesium rocket launch simulation
- Blue Bridge Cup multi interface switching processing (enumeration plus state machine method)
- [some notes]
- easyexcel的使用
- JPA and criteria API - select only specific columns - JPA & criteria API - select only specific columns
- Leetcode (Sword finger offer) - 58 - ii Rotate string left
- Seckill system 03 - redis cache and distributed lock
- Onenet Internet of things platform - mqtts product equipment connected to the platform
- IOS interview
猜你喜欢

Joint Time-Frequency and Time Domain Learning for Speech Enhancement
![[MCU] [nixie tube] nixie tube display](/img/5e/9e14302b4e4f5e03601392ac90479d.png)
[MCU] [nixie tube] nixie tube display

Consolidate -c operator

Computer graduation project asp Net hotel room management system VS development SQLSERVER database web structure c programming computer web page source code project

Indefinite integral

Onenet Internet of things platform - create mqtts products and devices

BIM and safety in road maintenance-buildSmart Spain

91.(cesium篇)cesium火箭發射模擬

Ipv6-6to4 experiment

2022-06-28-06-29
随机推荐
栈-------
JS reverse | m3u8 data decryption of a spring and autumn network
顺序表有关操作
leetcode 406. Queue reconstruction by height
Mysql database knowledge collation
[106] 360 check font - check whether the copyright of local Fonts is commercially available
Ipv6-6to4 experiment
[JS advanced] promise explanation
Typora realizes automatic uploading of picture pasting
On recursion and Fibonacci sequence
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
[speech signal processing] 3 speech signal visualization -- prosody
强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
[20211129] configuration du serveur distant du carnet de notes jupyter
Onenet Internet of things platform - mqtt product devices send messages to message queues MQ
MQ prevent message loss and repeated consumption
LeetCode力扣(剑指offer 31-35)31. 栈的压入弹出序列32I.II.III.从上到下打印二叉树33. 二叉搜索树的后序遍历序列34. 二叉树中和为某一值的路径35. 复杂链表的复制
Self organization is the two-way rush of managers and members
Golang根据参数引入相应配置文件的实现方式
Use of easyexcel