日经
文章平均质量分 61
吴钩揽月
这个作者很懒,什么都没留下…
展开
-
今天一个也没写出来
给两个链接这个没写出来http://www.cnblogs.com/scau20110726/archive/2012/12/21/2828420.html这个写的不好http://blog.csdn.net/mobius_strip/article/details/40506089原创 2014-11-23 16:46:55 · 499 阅读 · 0 评论 -
Fibonacci Heap实现
本算法是对<算法导论>相关章节伪代码的实现:先贴代码:#include#include#includeusing namespace std;class FibonacciHeap;class node{ friend class FibonacciHeap; node(int v):key(v),height(0),parent(NULL),left(this),righ原创 2015-01-02 08:40:02 · 755 阅读 · 0 评论 -
binomial heap实现
本算法是对<算法导论>相关章节的实现:下面贴代码:#include#includeusing namespace std;struct node{ node(int d):data(d),degree(0),parent(NULL),child(NULL),sibling(NULL){} int data; int degree; node* parent; node*原创 2014-12-30 18:38:05 · 1015 阅读 · 0 评论 -
Kruskal算法
算法导论第23章第2节#include#includeusing namespace std;struct node{ node(int i,int j,int l):x(i),y(j),len(l){} int x; int y; int len;};int N,M;int u,v,l;node* length[1000];int p[1000];int cnt原创 2014-12-28 15:28:21 · 626 阅读 · 0 评论 -
Single-source shortest paths in directed graphs
此算法为<算法导论>中第24章第2小节关于single-source shortest paths in directed graphs原理的实现.原著P592#includeusing namespace std;#define MAX 32767int N,M;int u,v,l,pos;int w[1000][1000],d[1000];int order[1000]原创 2014-12-22 17:21:57 · 566 阅读 · 0 评论 -
Shortest paths and matrix multiplication
本算法是对<算法导论>第25章第一节的实现有三个版本:第一个,普通版本://SLOW-ALL-PAIRS-SHORTEST-PATHS#includeusing namespace std;#define MAX 32767int N,M;int u,v,l;int W[1000][1000],Q[1000][1000],tmp[1000][1000];void p原创 2014-12-26 16:19:48 · 581 阅读 · 0 评论 -
Floyd_Warshall Algorithm
本算法是对算法导论上相关章节伪代码的实现:#include#include#includeusing namespace std;#define MAX 32767ifstream fin("data.in");int N,M;int u,v,l;int D[1000][1000],p[1000][1000],tmpD[1000][1000],tmpP[1000][1000原创 2014-12-27 16:08:13 · 592 阅读 · 0 评论 -
要看哈希了
POJ 1200http://blog.chinaunix.net/uid-22263887-id-1778919.html原创 2014-11-29 14:24:04 · 513 阅读 · 0 评论 -
elf_hash学习
#include#include#includeusing namespace std;unsigned long elf_hash(string str){ unsigned long h=0,g=0; string::iterator iter=str.begin(); while(iter!=str.end()) { h=(h<<4)+*iter; if((g=h转载 2014-12-20 15:58:36 · 556 阅读 · 0 评论 -
Prim算法
本算法是对《算法导论》相关章节伪代码的实现:这是第一次写的:#include#include#include#includeusing namespace std;#define MAX 32767 ifstream fin("data.in");struct node{ node(int x1,int y1,int len1):x(x1),y(y1),len(原创 2015-01-04 15:38:28 · 585 阅读 · 0 评论