首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
litery
2026年2月18日 23:41
二叉排序树 - 华科 题解:
P1396
回复 0
|
赞 1
|
浏览 66
#include <bits/stdc++.h> using namespace std; struct node{ int val; node* left; node* right; }; void Insert(node* &root,int t,int father){ if (root==nullptr){ root=new node{t,nullptr,nullptr}; cout<<father<<endl; } el...
cczz
2025年8月14日 19:30
题解思路:插入分支过程判断是否存在孩子节点,若不存在则可确定为父节点
P1396
回复 0
|
赞 3
|
浏览 710
#include<bits/stdc++.h> using namespace std; typedef struct node{ int data; struct node *lchild, *rchild; }*BitTree; void Insert(BitTree &T, int x){ if(T == NULL){ T = new node; T->data = x; T->lchild = NULL; T->rchild = NULL; return; } if(x &...
西电机试专家
2025年3月7日 10:59
二叉排序树 - 华科 题解:把父亲结点当做参数传进来就好了,easy
P1396
回复 1
|
赞 21
|
浏览 1.6k
#include <bits/stdc++.h> using namespace std; typedef struct node{ int data; struct node *lchild,*rchild; } *btree; void ct(btree &T,int x,int father){//注意应使用引用! if(T==NULL){ &n...
红鲤鱼
2025年3月14日 18:02
二叉排序树 - 华科 题解:
P1396
回复 0
|
赞 2
|
浏览 838
查找一个结点的父亲,只需要看父节点的左右孩子的值是否等于要查找的结点的值,不等于的话,就递归的查找。 #include<bits/stdc++.h> using namespace std; typedef struct node{ int data; struct node *lchild,*rchild; }Bnode,*BiTree; void insertnode(BiTree &T,int a){ if(T==NULL){ T=(BiTree)malloc(sizeof(Bnode)); ...
zxjrheaven
2025年3月4日 20:00
二叉排序树 - 华科 题解:爆改高分篇例题
P1396
回复 0
|
赞 4
|
浏览 1.0k
//二叉排序树 #include <bits/stdc++.h> using namespace std; int m; typedef struct node { int data; struct node *lchild,*rchild; }*BitTree; void InsertBitTree(BitTree &T, int x) { if (T == NULL) { // 当前子树为空,直接创建新节点 &nbs...
阿离
2024年3月15日 08:27
二叉排序树 - 华科 题解:边遍历边输出
P1396
回复 0
|
赞 15
|
浏览 2.4k
#include <bits/stdc++.h> using namespace std; typedef struct node{ int data; struct node *rchild,*lchild; }*BitTree; int tmp=-1; void Insert(BitTree &T,int x){ if(T==NULL){ T=ne...
1935569240
2024年3月9日 20:28
二叉排序树 - 华科 题解:简单代码如下:
P1396
回复 0
|
赞 5
|
浏览 1.7k
#include<iostream> #include<algorithm> #include<string> using namespace std; struct node { int data; struct node* left, * right; }; struct node* insertTree(struct node* T, int x, struct node* parent) { if (T =...
孙某人
2024年3月5日 18:02
二叉排序树 - 华科 题解:还有22天上机考试,大佬们可以祝我上岸吗
P1396
回复 2
|
赞 3
|
浏览 2.1k
自己写的通过率只有40%因为超出存储范围(主要是题目数据最大有十位),思路是我感觉写一下 1.层次遍历建立二叉树,用#include头文件(非递归),先在main里面赋给其存储 (i)queue Q 初始化队列 给队列定义一个名字 <>里面是类型,后面给队列取一个名字Q (ii)Q.push(L) ------>入队 (iii)一个while()循环(借鉴别人的二叉树层次遍历,注意不是建立,!Q.empty里面要写作为退...
DestinyCares+++
2024年2月1日 21:48
二叉排序树 - 华科 题解:
P1396
回复 0
|
赞 0
|
浏览 1.1k
#include<iostream> #include<string> using namespace std; int m = -1; typedef struct Tnode { int data; struct Tnode* lchild, * rchild; }Tnode, * Tree; void Insert(Tree &T,int x,Tree &p) { if (T == NULL) { &nbs...
蟹蟹
2023年7月3日 22:11
二叉排序树 - 华科 题解:
P1396
回复 0
|
赞 3
|
浏览 1.5k
#include<stdio.h> typedef struct orderTree { int data; struct orderTree *lchild,*rchild; }tree,*Btree; int main() { void initalTree(tree **T ,int d); //初始化树 void insert(int d,tree **T); //插入节点 tree *t; int sum=0...
1
2
题目
二叉排序树 - 华科
题解数量
15
发布题解
在线答疑
热门题解
1
二叉排序树 - 华科 题解:把父亲结点当做参数传进来就好了,easy
2
二叉排序树 - 华科 题解:边遍历边输出
3
二叉排序树 - 华科 题解:简单代码如下:
4
二叉排序树 - 华科 题解:爆改高分篇例题
5
签到题
6
题解思路:插入分支过程判断是否存在孩子节点,若不存在则可确定为父节点
7
二叉排序树 - 华科 题解:还有22天上机考试,大佬们可以祝我上岸吗
8
二叉排序树 - 华科 题解:
9
模板题
10
二叉排序树 - 华科 题解: