题干:splay模板,要求维护区间反转。 splay是一种码量小于treap,但支持排名,前驱后继等treap可求的东西,也支持区间反转的平衡树。 但是有两个坏处: 1.splay常数远远大于treap以及stl中的set。 2.没有可持久化splay,但有可持久化treap。 下面是代码: 1.p ...
分类:
其他好文 时间:
2018-09-05 18:06:40
阅读次数:
242
题目链接 https://leetcode.com/problems/kth smallest element in a bst/description/ 题目描述 Given a binary search tree, write a function kthSmallest to find th ...
分类:
其他好文 时间:
2018-08-28 14:26:01
阅读次数:
154
```C++ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead, unsigned int k) { if(pListHead == nullptr) return nullptr; int len = 0; L... ...
分类:
其他好文 时间:
2018-08-25 20:01:58
阅读次数:
164
使用SAN共享存储空间
一 配置后端存储
1.1 装包
1.2 修改配置文件
1.3 启动服务
1.4 查看
1.1 装包
yum list |grep -i scsi
yum -y install scsi-target-utils
rpm -qc scsi-target-utils
1.2 修改配置文件
vim /etc/tgt/targets.conf
<target iqn.2018-01.cn.tedu.56.diskb>
63 backing-store /dev/vdb 定义存储设备
66 write-cache off
# initiator-address 192.168.4.53 定义前端ip
67 vendor_id tarena 定义出厂商
product_id disktwo 定义磁盘标识
68 </target>
<target iqn.2018-01.cn.tedu.56.diskc>
73 backing-store
分类:
其他好文 时间:
2018-08-17 11:27:22
阅读次数:
300
Given array of integers, remove each kth element from it. Example For inputArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and k = 3, the output should beextr ...
分类:
其他好文 时间:
2018-08-16 00:37:19
阅读次数:
173
Top K问题在数据分析中非常普遍的一个问题(在面试中也经常被问到),比如: 从20亿个数字的文本中,找出最大的前100个。 解决Top K问题有两种思路, 最直观:小顶堆(大顶堆 -> 最小100个数); 较高效:Quick Select算法。 LeetCode上有一个问题215. Kth Lar ...
分类:
其他好文 时间:
2018-08-14 22:57:54
阅读次数:
206
在加入QCustomplot时有如题的错误 1>c:\program files (x86)\microsoft visual studio11.0\vc\include\xutility(2176): error C4996: 'std::_Copy_impl': Function callwit ...
分类:
其他好文 时间:
2018-08-12 17:18:21
阅读次数:
175
B组: 阶乘 Description Description 有n个正整数a[i],设它们乘积为p,你可以给p乘上一个正整数q,使p*q刚好为正整数m的阶乘,求m的最小值。 Data Constraint 对于10%的数据,n<=10对于30%的数据,n<=1000对于100%的数据,n<=1000 ...
分类:
其他好文 时间:
2018-08-10 23:22:28
阅读次数:
442
什么是 Mock 测试 Mock 测试就是在测试过程中,对于某些不容易构造(如 HttpServletRequest 必须在Servlet 容器中才能构造出来)或者不容易获取比较复杂的对象(如 JDBC 中的ResultSet 对象),用一个虚拟的对象(Mock 对象)来创建以便测试的测试方法。 M ...
分类:
其他好文 时间:
2018-08-10 19:32:49
阅读次数:
183