最近做的一个需求,当列表大概有2万条数据,又不让做成分页,如果页面直接渲染2万条数据,在一些低配电脑上可能会照成页面卡死,基于这个需求,我们来手写一个虚拟列表 思路 1. 列表中固定只显示少量的数据,比如60条 2. 在列表滚动的时候不断的去插入删除dom 3. startIndex、endInde ...
分类:
其他好文 时间:
2019-09-30 20:00:36
阅读次数:
99
1.Minimum Depth of Binary Tree 2.Maximum Depth of Binary Tree 3.Path Sum 4.Path Sum II 5.Binary Tree Maximum Path Sum ...
分类:
其他好文 时间:
2019-09-27 01:29:49
阅读次数:
85
题目如下: Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. Return a list of p ...
分类:
其他好文 时间:
2019-09-25 10:51:44
阅读次数:
99
HBase中JVM基本配置 在JVM中,默认情况下会设置minimum heap size 为 1/64 可用物理内存,并为maximum heap size设置 1/4 的物理可用内存(不过在Java8 之前,默认最大是1g)。当然,我们可以通过手动指定 JVM 参数,配置JVM的内存,例如: 在 ...
分类:
其他好文 时间:
2019-09-23 18:04:56
阅读次数:
129
minimum_should_match 只能用在multi_match里 可以这样写: 表示命中4个词的文档才会返回 也可以这样写: 这里的80%是指query的分词个数的80% 我们调一下分词接口,看结果: query被分成了4个词,所以minimum_should_match:"80%" 在这 ...
分类:
其他好文 时间:
2019-09-23 12:12:48
阅读次数:
66
1 #define _for(i,a,b) for(int i = (a);i b;i --) 3 #define INF 0x3f3f3f3f 4 #define MOD 1000000007 5 #define pb push_back 6 #define maxn 10003 7 8 clas... ...
分类:
其他好文 时间:
2019-09-22 12:44:47
阅读次数:
92
简直精妙。 哈夫曼编码? 我用的是dp,这种区间dp的时间复杂度是真的难算!状态转移方程为n的区间dp时间都算作n^3吧。 先把任务从长到短排序,然后看worker在那一层要细分多少?就是位置i和员工数n的dp转移。 但是可以贪心!!!!!!!!!!!!每次都是把时间最短的放在最后,而且这两个必然同 ...
分类:
其他好文 时间:
2019-09-22 10:36:43
阅读次数:
101
描述Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= ...
分类:
其他好文 时间:
2019-09-19 23:24:41
阅读次数:
122
Question For an undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all poss ...
分类:
其他好文 时间:
2019-09-14 00:13:58
阅读次数:
103