给定一个二叉树,判断它是否是高度平衡的二叉树。 本题中,一棵高度平衡二叉树定义为: 一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1 。 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/balanced-binary-tree 著作 ...
分类:
其他好文 时间:
2020-12-03 11:59:09
阅读次数:
6
题目 Petya has equal wooden bars of length n. He wants to make a frame for two equal doors. Each frame has two vertical (left and right) sides of length ...
分类:
其他好文 时间:
2020-11-30 16:00:25
阅读次数:
6
##错误 huny@DESKTOP-N1EBKQP:/mnt/c/Users/Administrator$ sudo apt-get install python3 Reading package lists... Done Building dependency tree Reading stat ...
分类:
编程语言 时间:
2020-11-30 15:30:15
阅读次数:
8
void copy(BiTree T,BiTree &NewT){ //复制树 if(T == NULL){ NewT = NULL; return; }else { NewT = new BiTNode; NewT->data = T->data; copy(T->lchild,NewT->lch ...
分类:
其他好文 时间:
2020-11-30 15:28:17
阅读次数:
2
一、Table Demo CREATE TABLE `employees` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(24) NOT NULL DEFAULT '' COMMENT '姓名', `age` int(11) NOT N ...
分类:
数据库 时间:
2020-11-30 15:26:05
阅读次数:
7
根据上图, 构造出来的最小生成树的权值和应为 16. 主要部分代码: /** * 将最小生成树保存为邻接表存储的图 MST, 返回最小权重和 * @param Graph * @param MST 即 Minimun-cost Spanning Tree 最下生成树 * @return */ int ...
分类:
编程语言 时间:
2020-11-30 15:25:45
阅读次数:
4
link /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NUL ...
分类:
其他好文 时间:
2020-11-27 11:14:59
阅读次数:
5
CF1010F Tree [* easy] 给定一棵根节点为 $1$ 的二叉树 \(T\),你需要先保留一个包含 $1$ 号节点的连通块,然后给每个点确定一个权值 \(a_i\),使得对于每个点 \(u\) 都有其权值 \(a_u\) 大于等于其所有儿子的权值和 \(\sum a_v[(u,v)\i ...
分类:
其他好文 时间:
2020-11-27 11:06:06
阅读次数:
6
/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ /** * Return an arr ...
分类:
其他好文 时间:
2020-11-26 14:41:52
阅读次数:
8
背景 在分析Linux内核驱动的时候,有时候会看到一些acpi字样的接口。 之前一直没搞明白ACPI是什么,现在知道了。 ACPI Advanced Configuration and Power Management Interface : 用于配置与电源管理的接口,是让OS使用的。用在x86架构 ...
分类:
其他好文 时间:
2020-11-25 12:39:07
阅读次数:
6