会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
默默无语敲代码
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
下一页
2017年7月31日
AVL-TREE
摘要: /** * 为了 看了行出些 就不写树堆那样的 结构了。 虽然操作 方便些。 */public class AVLTree, Value> { private class Node { private final Key key; private Value val; private int height; priv...
阅读全文
posted @ 2017-07-31 10:04 默默无语敲代码
阅读(180)
评论(0)
推荐(0)
2017年7月26日
ReentrantLock
摘要: ReentrantLock : 可以创建 公平 or 非公平锁, 本问主要说非 公平锁 知,lock, trylock,lockInterruptibly 这里是架构图,太简单了 不补了 ReentrantLock 内部主要类 2. 非公平锁的lock 过程 公平锁和 非公平的差不多, 只不过没有插
阅读全文
posted @ 2017-07-26 18:00 默默无语敲代码
阅读(164)
评论(0)
推荐(0)
2017年1月22日
treap-名次树-树堆
摘要: #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 默默无语敲代码
阅读(158)
评论(0)
推荐(0)
2016年11月30日
细数那些我们熟悉的 排序!
摘要: 第一个 ,不得不说的 是 <冒泡排序> 作为 一个非常经典,又差劲的算法 。 计算过程如下: ->每次遍历数组,通过对比,使最大的冒上去, ->这样通过N次的轮循 ,可以使 排序的数组有序。 优点:简单,适用性强。 缺点:慢。 适用性:数组,链表. 性质:稳定性排序【打乱元素的稳定性,也就是 你不知
阅读全文
posted @ 2016-11-30 23:32 默默无语敲代码
阅读(286)
评论(0)
推荐(1)
2016年10月25日
数据结构 - trie
摘要: 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 默默无语敲代码
阅读(211)
评论(0)
推荐(0)
2016年8月26日
python 凸包(经纬度) + 面积[近似]
摘要: 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 默默无语敲代码
阅读(2278)
评论(0)
推荐(1)
2016年8月3日
区间第K大
摘要: 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 默默无语敲代码
阅读(159)
评论(0)
推荐(0)
2016年7月21日
全文检索引擎Solr 指南
摘要: 全文检索引擎Solr系列:第一篇:http://t.cn/RP004gl、第二篇:http://t.cn/RPHDjk7 、第三篇:http://t.cn/RPuJt3T
阅读全文
posted @ 2016-07-21 16:53 默默无语敲代码
阅读(163)
评论(0)
推荐(0)
2016年7月20日
trie + 长度优先匹配,生成串
摘要: 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 默默无语敲代码
阅读(224)
评论(0)
推荐(0)
2016年7月13日
日期化脚本
摘要: #!/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 默默无语敲代码
阅读(202)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
下一页
公告