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-04-22 12:51:03
阅读次数:
65
给定一个非负索引 k,其中 k ≤ 33,返回杨辉三角的第 k 行。 在杨辉三角中,每个数是它左上方和右上方的数的和。 1 class Solution(object): 2 def getRow(self, rowIndex): 3 """ 4 :type rowIndex: int 5 :rty ...
分类:
其他好文 时间:
2020-04-22 00:00:58
阅读次数:
55
思路: 想到:prices中一列数字,任取一个为买入价格buy,在其右边任取一个为卖出价格sell;取[buy,...,sell]区间中相邻数字之差,这些差值求和为sum,则必有sell-buy = sum;本题中求最大收益,所以遍历prices,找到prices[i]-prices[i-1] > ...
分类:
其他好文 时间:
2020-04-21 23:53:32
阅读次数:
64
PV:page view、网页浏览量 什么是pv:即浏览器发送一个request请求,服务器返回一个page称为一个PV。 不管服务器返回的page是否打开了或者下载完了,都会计算成一个pv。 UV:Unique Visitor。独立访客数 以cookie和ip作为依据。记录一天内所有的cookie ...
分类:
其他好文 时间:
2020-04-21 18:30:41
阅读次数:
67
题目: 从上到下按层打印二叉树,同一层的节点按从左到右的顺序打印,每一层打印到一行。 例如:给定二叉树: [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7返回其层次遍历结果: [ [3], [9,20], [15,7]] 提示: 节点总数 <= 1000 解答 ...
分类:
其他好文 时间:
2020-04-21 16:50:29
阅读次数:
54
数据唯一性 先建立primary index或者unique index: INSERT IGNORE REPLACE https://www.tutorialspoint.com/mysql/mysql handling duplicates.htm https://www.mysqltutori ...
分类:
其他好文 时间:
2020-04-21 14:49:43
阅读次数:
55
4月20日,腾讯发布了TPC-4数据中心开放光网络传输平台的电层产品,本方案所使用的CFP2封装的400G DCO模块采用了来自II-VI 最新的相干光学引擎与 Inphi最新的7nm DSP的组合,实现了高性能的400G与200G的可插拔方案。
分类:
其他好文 时间:
2020-04-20 23:43:58
阅读次数:
200
"欢迎来访" 首先看一下卡特兰数。若一个数列$h_n$满足: $$h_n = \sum_{i=0}^{n 1}h_i \cdot h_{n 1 i}$$ 则称$h_n$为卡特兰数列。 还有一种形式若: $$h_n = \frac{C_{2n}^n}{n+1}$$ 也称$h_n$为卡特兰数列 那什么样 ...
分类:
其他好文 时间:
2020-04-20 21:58:10
阅读次数:
79
Paths on the treeProblem Descriptionbobo has a tree, whose vertices are conveniently labeled by 1,2,…,n.** There are m paths on the tree. bobo would l ...
分类:
其他好文 时间:
2020-04-19 18:07:45
阅读次数:
62
问题: 给定一个n,有数组1~n, 排列该数组,使得数组两两元素之间的差值有k种。 Example 1: Input: n = 3, k = 1 Output: [1, 2, 3] Explanation: The [1, 2, 3] has three different positive int ...
分类:
其他好文 时间:
2020-04-19 14:58:40
阅读次数:
57