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
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
1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), ...
分类:
其他好文 时间:
2020-05-06 11:59:27
阅读次数:
66
用python写的一朵玫瑰花,有画图过程,效果图如下: 不好意思啦,时间太紧,还没来得及上传。 本来想把这个页面删掉的,但是又不想后面上传的时候再新建,所以就保持这样了。 可以先看看 【Heart_tree】 【Cherry tree】 【Anime girl】 ...
分类:
其他好文 时间:
2020-05-06 01:23:08
阅读次数:
54
Border默认透明,不响应MouseDown等事件 点击会从透明的Border穿过到下一个控件=.=(所以和ZIndex无关) 设置 才能“点击”成功,响应MouseDown事件 同理可推导,有时候需要设置容器背景为“白色”,有时候需要设置为“透明”(Transparent),看需求 示例代码 " ...
分类:
其他好文 时间:
2020-05-05 23:49:48
阅读次数:
120
决策树的理解 决策树是一种机器学习的方法。决策树的生成算法有ID3, C4.5和CART等。决策树是一种树形结构,其中每个内部节点表示一个属性上的判断,每个分支代表一个判断结果的输出,最后每个叶节点代表一种分类结果。 决策树是一种十分常用的分类方法,需要监管学习(有教师的Supervised Lea ...
分类:
其他好文 时间:
2020-05-05 20:09:36
阅读次数:
1309