摘要: /** * 为了 看了行出些 就不写树堆那样的 结构了。 虽然操作 方便些。 */public class AVLTree, Value> { private class Node { private final Key key; private Value val; private int height; priv... 阅读全文
posted @ 2017-07-31 10:04 默默无语敲代码 阅读(174) 评论(0) 推荐(0) 编辑
摘要: ReentrantLock : 可以创建 公平 or 非公平锁, 本问主要说非 公平锁 知,lock, trylock,lockInterruptibly 这里是架构图,太简单了 不补了 ReentrantLock 内部主要类 2. 非公平锁的lock 过程 公平锁和 非公平的差不多, 只不过没有插 阅读全文
posted @ 2017-07-26 18:00 默默无语敲代码 阅读(162) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; struct Node{ Node *ch[2]; int rank , value , size; const static int mod = 100; Node(int x){ value = x; rank = rand(... 阅读全文
posted @ 2017-01-22 11:42 默默无语敲代码 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 第一个 ,不得不说的 是 <冒泡排序> 作为 一个非常经典,又差劲的算法 。 计算过程如下: ->每次遍历数组,通过对比,使最大的冒上去, ->这样通过N次的轮循 ,可以使 排序的数组有序。 优点:简单,适用性强。 缺点:慢。 适用性:数组,链表. 性质:稳定性排序【打乱元素的稳定性,也就是 你不知 阅读全文
posted @ 2016-11-30 23:32 默默无语敲代码 阅读(282) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 class Trie{ 7 private : 8 map * root; 9 pair info; 10 inline Trie * makeNext(char c){ 11 if(root ... 阅读全文
posted @ 2016-10-25 11:08 默默无语敲代码 阅读(205) 评论(0) 推荐(0) 编辑
摘要: def cross(A,B): return A[0] * B[1] - A[1] * B[0] def vectorMinus( a , b): return ( (a[0] - b[0] )*1000,(a[1] - b[1] )*1000) def getLTDis( A, B ): lon1, lat1, lon2, lat2 = map(radians, [... 阅读全文
posted @ 2016-08-26 14:33 默默无语敲代码 阅读(2260) 评论(0) 推荐(1) 编辑
摘要: protected static int partitions(List data,int left,int right,int k,int pos){ int l = left,r = right; if(l==r) return l; KDNode key = data.get(l); while (l key.get... 阅读全文
posted @ 2016-08-03 14:35 默默无语敲代码 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 全文检索引擎Solr系列:第一篇:http://t.cn/RP004gl、第二篇:http://t.cn/RPHDjk7 、第三篇:http://t.cn/RPuJt3T 阅读全文
posted @ 2016-07-21 16:53 默默无语敲代码 阅读(157) 评论(0) 推荐(0) 编辑
摘要: import com.google.common.collect.Maps; import java.util.Map; /** * tree 节点 * Created by shuly on 16-7-18. */ public class Node { boolean isRoot; boolean isEnd; int cnt; Map... 阅读全文
posted @ 2016-07-20 09:39 默默无语敲代码 阅读(220) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash . /etc/profile if [ $# == 0 ]; then SDATE=$(date "+%F" -d "-1 days") EDATE=$(date "+%F" -d "-1 days") elif [ $# == 1 ]; then SDATE=$1 EDATE=$1 else SDATE=$1 ... 阅读全文
posted @ 2016-07-13 15:53 默默无语敲代码 阅读(194) 评论(0) 推荐(0) 编辑