In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they have ...
分类:
其他好文 时间:
2020-05-08 12:40:20
阅读次数:
59
为了达到较高的执行效率,lua代码并不是直接被Lua解释器解释执行,而是会先编译为字节码,然后再交给lua虚拟机去执行 lua代码称为chunk,编译成的字节码则称为二进制chunk(Binary chunk) lua.exe、wlua.exe解释器可直接执行lua代码(解释器内部会先将其编译成字节 ...
分类:
其他好文 时间:
2020-05-08 00:28:31
阅读次数:
72
Given a non-empty tree with root R, and with weight W?i?? assigned to each tree node T?i??. The weight of a path from R to L is defined to be the sum ...
分类:
其他好文 时间:
2020-05-07 23:06:39
阅读次数:
102
https://leetcode-cn.com/problems/subtree-of-another-tree/ 我们需要借助一个helper方法,这个思想就是双递归,即判断每个大树的节点和小树的根节点的值是否相等,如果相同就进入子树判断方法。否则就在大树节点的左节点和右节点查找。 helper方 ...
分类:
其他好文 时间:
2020-05-07 13:50:01
阅读次数:
58
https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/solution/li-jie-zhe-dao-ti-de-jie-shu-tiao-jian-by-user7208/ 思路:有个特殊情况,比如树是1,2.这样的话,根节点为 ...
分类:
其他好文 时间:
2020-05-07 10:48:03
阅读次数:
60
from PIL import Image import numpy as np a = np.asarray(Image.open(r'C:\Users\Administrator\Pictures\院徽.jpg').convert('L')).astype('float') depth = 10 ...
分类:
其他好文 时间:
2020-05-06 21:44:04
阅读次数:
74
from PIL import Image import numpy as np vec_el = np.pi/2.2 # 光源的俯视角度,弧度值 vec_az = np.pi/4. # 光源的方位角度,弧度值 depth = 10. # (0-100) im = Image.open('C:/Us ...
分类:
其他好文 时间:
2020-05-06 19:47:21
阅读次数:
55
Python virtual env 最近在用ops写的一个脚本,需要用到python 3,以及部分安装依赖,于是顺利的安装了python 3的环境,但是一切并没有那么的顺利,依赖的一个包死活无法安装,于是了解到了python的 "虚拟环境" . 使用 命令行输出 可以看到文件中多了一个v env的 ...
分类:
编程语言 时间:
2020-05-06 15:35:47
阅读次数:
90
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino ...
分类:
其他好文 时间:
2020-05-06 13:56:18
阅读次数:
55
题目描述 给定一个二叉搜索树,编写一个函数?kthSmallest?来查找其中第?k?个最小的元素。 说明: 你可以假设 k 总是有效的,1 ≤ k ≤ 二叉搜索树元素个数。 示例: 题目链接: https://leetcode cn.com/problems/kth smallest elemen ...
分类:
其他好文 时间:
2020-05-06 12:02:09
阅读次数:
46