地址:https://leetcode-cn.com/problems/minimum-height-tree-lcci/ <?php /** 面试题 04.02. 最小高度树 给定一个有序整数数组,元素各不相同且按升序排列,编写一个算法,创建一棵高度最小的二叉搜索树。 示例: 给定有序数组: [- ...
分类:
其他好文 时间:
2020-05-21 16:03:18
阅读次数:
55
地址:https://leetcode-cn.com/problems/univalued-binary-tree/ <?php /** 965. 单值二叉树 如果二叉树每个节点都具有相同的值,那么该二叉树就是单值二叉树。 只有给定的树是单值二叉树时,才返回 true;否则返回 false。 示例 ...
分类:
其他好文 时间:
2020-05-21 14:40:42
阅读次数:
53
题1:一棵树每层节点的平均数(Average of Levels in Binary Tree) LeetCode题号:637 难度:Easy 链接:https://leetcode-cn.com/problems/average-of-levels-in-binary-tree/ 题目描述: 给定 ...
分类:
其他好文 时间:
2020-05-21 00:32:36
阅读次数:
62
题意描述 给定一个二叉树,返回其节点值的层数顺序遍历。 (即,从左到右,逐级)。 测试用例 Given binary tree , return its level order traversal as: 解题思路 一、思路一 使用递归,根据树深度判断节点值应该添加入集合的哪个位置。 二、思路二 使 ...
分类:
其他好文 时间:
2020-05-20 23:56:25
阅读次数:
78
使用Maven命令方式: 一、Terminal 命令方式 例如:mvn dependency:tree 二、Edit Configurations 方式 新增一个 Maven 配置,Command line 输入命令。 参考: https://blog.csdn.net/Zheng_xiao_xin ...
分类:
其他好文 时间:
2020-05-20 12:02:21
阅读次数:
56
https://www.spoj.com/problems/QTREE6/ 考虑对0颜色和1颜色分别维护定根(no reverse)lct。 即在$c[x]$的lct上给$x$到$fa[x]$连一条边。 修改直接link、cut。 查询x的话,考虑access走到最上面的点,这个点实际上和x是不连通 ...
分类:
其他好文 时间:
2020-05-19 23:14:24
阅读次数:
100
1 from PIL import Image,ImageDraw 2 img = Image.open(r'C:\Users\87823\Desktop\tree.png') 3 w,h = img.size 4 # 创建绘图对象 5 draw_obj = ImageDraw.Draw(img) ...
分类:
其他好文 时间:
2020-05-19 18:09:00
阅读次数:
62
路径值如图:以太网 19 ,百兆网 4. BID如图:列如:32769 0001.635C.D3A5 A,B,C,D,E为交换机的名字 查看BID的命令为:show spanning-tree 在同一个vlan里面: STP的流程: 1.选择根桥: 如图:比较全部设备的BID,其中E的BID最小(由 ...
分类:
其他好文 时间:
2020-05-19 16:28:13
阅读次数:
72
1 from PIL import Image,ImageEnhance 2 img = Image.open(r'C:\Users\87823\Desktop\tree.png') 3 w,h = img.size 4 img_output = Image.new('RGB',(3*w,h)) 5 ...
分类:
其他好文 时间:
2020-05-19 12:57:07
阅读次数:
54
题目: 二叉树的最大深度:给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 说明: 叶子节点是指没有子节点的节点。 思路: 借助层序遍历来做,有多少层树就有多深。 程序: # Definition for a binary tree node. # clas ...
分类:
编程语言 时间:
2020-05-19 11:06:30
阅读次数:
164