自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(207)
  • 收藏
  • 关注

转载 一致性哈希(Consistent Hashing)原理

-转自【http://afghl.github.io/2016/07/04/consistent-hashing.html】,仅供学习看一些分布式相关的技术文章或书籍时,经常看到一个词,一致性哈希。对于这个技术一直似懂非懂。今天花了半天的时间好好研究了它的原理和实现,发现一点都不复杂。于是写篇文章分享一下。下面,我们就从基本的Hash算法说起。负载均衡与Hash算法分布式系统中(如...

2018-10-21 15:11:47 273

原创 2PC

一、二阶段提交(2PC)  分布式系统的一个难点是如何保证架构下多个节点在进行事务性操作的时候保持一致性。为实现这个目的,二阶段提交算法的成立基于以下假设:该分布式系统中,存在一个节点作为协调者(Coordinator),其他节点作为参与者(Cohorts)。且节点之间可以进行网络通信。 所有节点都采用预写式日志,且日志被写入后即被保持在可靠的存储设备上,即使节点损坏不会导致日志数据的消...

2018-10-21 09:42:06 185

原创 RDMA远程直接内存访问

RDMA(RemoteDirect Memory Access)技术全称远程直接内存访问,就是为了解决网络传输中服务器端数据处理的延迟而产生的。它将数据直接从一台计算机的内存传输到另一台计算机,无需双方操作系统的介入。这允许高吞吐、低延迟的网络通信,尤其适合在大规模并行计算机集群中使用。RDMA通过网络把资料直接传入计算机的存储区,将数据从一个系统快速移动到远程系统存储器中,而不对操作系统造成任何...

2018-10-19 18:22:29 592

原创 OSI 7层模型与TCP/IP

1,应用层:原始的数据2,表示层:数据的个格式转换,比如加密解密,压缩与解压缩。3,会话层:对应用的会话管理与同步,拥有不同机器翻译的功能。4,传输层:进程端口的确定5,网络层:ip的确定6,数据链路成:mac(网卡)的确定7,物理规则的确定。...

2018-10-17 15:41:45 257

原创 总有一些路,要一个人走————viseen

已经好久没有写博客了,现在有重新开启了自己的博客之旅。时间是一个神奇的东西,它总会把你安排到你意想不到位置,无法逃避。所以面对一些事,没有必要拥有太多的情绪,慢慢的完成就可以了。一些使用这三句话来激励自己砥砺前行的5年。跟从内心的平静;勿以恶小而为之,勿以善小而不为;专注中产生快乐。...

2018-10-16 18:46:48 439

原创 poj 1001 a+b

#include#include#include#include#includeusing namespace std;int main(){    int a,b;    while(scanf("%d%d",&a,&b)!=EOF)        printf("%d\n",a+b);    return 0;}

2015-03-16 22:43:21 527

原创 我的poj 计划

写了好久代码,偶然间我放弃了,长时间下来,感觉一切都是好空啊。无所事事,想一个傻子似的。我应该回到自己的代码时代,虽然我曾经放弃,但现在的我会像一个新手慢慢开始自己的代码之旅。初学者题:;100110371048104910511067;模拟问题:;100610091012101610191023;动态规划:;101310221025102710741076;字符串处理问题:;10021004

2015-03-10 13:31:44 544

原创 hdu 1003 最大最长上升子序列 贪心

要想找到符合条件的序列,我们应该有以下条件

2014-11-04 12:20:28 525

原创 hdu 1003 最大最长子序列 dp

我的dp思路是记b[j]表示到j

2014-11-03 20:29:38 513

原创 hdu 2191 多重背包

http://acm.hdu.edu.cn/showproblem.php?pid=2191#include#include#include#include#include#includeusing namespace std;struct ele{    int price;    int wight;    int num;}p[12

2014-10-24 16:37:05 403

原创 百练 1088

http://bailian.openjudge.cn/practice/1088#include#include#include#include#include#includeusing namespace std;int mat[120][120];int dp[120][120];struct ele{    int x;    i

2014-10-24 14:35:40 559

原创 hdu 4508

http://acm.hdu.edu.cn/showproblem.php?pid=4508#include#include#include#include#include#includeusing namespace std;const int sizen=100100;int a[sizen];int b[sizen];__int64 dp[

2014-10-23 20:27:39 450

原创 poj 3628

http://poj.org/problem?id=3628#include#include#include#include#include#include#includeusing namespace std;int n,b;int a[50];int dp[1210000];int main(){    int Min;

2014-10-23 13:33:30 483

原创 poj 1837

http://poj.org/problem?id=1837#include#include#include#include#include#includeusing namespace std;int dp[21][15001];int main(){    int n,m;    int c[50];    int g[50]

2014-10-23 09:42:23 435

原创 hdu 5074

http://acm.hdu.edu.cn/showproblem.php?pid=5074

2014-10-22 20:08:47 497

原创 zoj 3822 dp

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5376

2014-10-22 20:06:01 392

原创 hdu 4055

http://acm.hdu.edu.cn/showproblem.php?pid=4055

2014-10-22 09:28:18 445

原创 poj 3624 01背包

http://poj.org/problem?id=3624主要注意的是内存的优化yixiashi

2014-10-22 09:22:20 420

原创 hdu 4055 dp

http://acm.hdu.edu.cn/showproblem.php?pid=4055#include#include#include#include#include#includeusing namespace std;const int mod=1000000007;const int sizen=1010;__int64 dp[sizen

2014-10-21 19:12:32 478

原创 最佳加法表达式 dp

#include#include#include#include#include#includeusing namespace std;int Map[100][200];char str[500];int change(int x,int y){    int i;    int t=0;    for(i=x;i    {

2014-10-20 20:11:22 704

原创 zoj 1649 BFS

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=649我觉得这题写的很好以下为我的代码http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=64

2014-10-20 19:13:51 430

原创 最长上升子序列 dp

http://bailian.openjudge.cn/practice/2757/#include#include#include#include#includeusing namespace std;const int sizen=10000;struct ele{    int value;    int num;}p[sizen];

2014-10-20 10:56:03 438

原创 zoj 1008 dfs 一种巧妙的剪枝

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=8我做此题错了好几c

2014-10-20 10:23:42 392

原创 poj 1979

水,不解释了#include#include#include#include#include#includeusing namespace std;const int sizen=150;int cnt;bool Map[sizen][sizen];int d[4][2]={1,0,-1,0,0,1,0,-1};void DFS(int x,int y){

2014-10-18 10:12:50 420

原创 poj 1163

http://poj.org/problem?id=1163以我的理解,他们这是对递归的chongjish

2014-10-17 16:19:34 430

原创 poj 2299 线段树

http://poj.org/problem?id=2299我因为忘了估计总数的值youke

2014-10-16 17:31:07 456

原创 zoj 2412 搜索

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1412我的代码taic

2014-10-15 18:29:36 393

原创 poj 1562

http://poj.org/problem?id=1562我还是有点buxin#include#include#include#include#include#includeusing namespace std;const int sizen=1000;bool Map[sizen][sizen];int m,n;int d[8][2]=

2014-10-15 14:47:36 404

原创 hdu 1010 奇偶标记法

http://acm.hdu.edu.cn/showproblem.php?pid=1010我错了好几次,

2014-10-15 08:46:48 382

原创 hdu 1394 归并排序

#include#include#include#include#include#includeusing namespace std;const int sizen=100000;int a[sizen],b[sizen],c[sizen];int t;int num;void Merge(int x,int Mid,int y){

2014-10-14 17:06:19 481

原创 hdu 1394 线段树

http://acm.hdu.edu.cn/showproblem.php?pid=1394

2014-10-14 17:05:10 366

原创 hdu 1394 暴力法

#include#include#include#include#include#includeusing namespace std;const int sizen=100000;int arr[sizen];int main(){ int n; int i,j; int sum; int minn; int x; whil

2014-10-14 17:04:10 393

原创 拓扑排序 链式向前星

#include#include#include#include#include#includeusing namespace std;const int sizen=1000000;struct ele{    int to;    int next;}p[sizen];bool Map[1000][1000];int degree

2014-10-14 10:31:18 666

原创 拓扑排序

邻接矩阵,我的模板#include#include#include#include#include#includeusing namespace std;const int sizen=1000;bool Map[sizen][sizen];int degree[sizen];bool mark[sizen];void tosort(

2014-10-14 09:30:57 346

原创 链式向前星 BFS

#include#include#include#include#include#include#includeusing namespace std;const int sizen=1000;int head[sizen];bool mark[sizen];struct ele{    int to;    int w;   

2014-10-13 19:52:13 934

原创 链式向前星 DFS

#include#include#include#include#include#includeusing namespace std;const int sizen=10000;bool mark[sizen];struct ele{    int to;    int w;    int next;}p[sizen];int

2014-10-13 17:59:35 526

原创 邻接矩阵 BFS

#include#include#include#include#include#include#includeusing namespace std;const int sizen=10000;int Map[sizen][sizen];bool mark[sizen];void BFS(int x,int n){    int

2014-10-13 17:24:18 887

原创 邻接矩阵 DFS

#include#include#include#include#include#includeusing namespace std;const int sizen=10000;bool mark[sizen];int Map[sizen][sizen];void DFS(int x,int n){    int i;    p

2014-10-13 16:59:08 527

原创 图的存储,链式向前星

我总会无缘无故的记错一点东西;我需要再次确认一下:

2014-10-13 13:18:50 486

原创 poj 1659 havel-hakimi 定理

http://poj.org/problem?id=1659定理:

2014-10-13 10:08:55 463

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除