上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: Peter studies the theory of relational databases. Table in the relational database consists of values that are arranged in rows and columns.There are ... 阅读全文
posted @ 2014-11-17 21:40 闪光阳 阅读(1037) 评论(0) 推荐(0) 编辑
摘要: 在讲三元组之前,让我回忆一下,正常情况下该如何存储一个矩阵呢?话不多说,看下面的代码1 void save_Matrix() {2 int row,col;3 cin >> row >> col;4 for (int i = 0;i > a[i][j];7 }... 阅读全文
posted @ 2014-11-08 12:13 闪光阳 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 为什么要对next进行改进呢?因为next存在缺陷。。。O(∩_∩)O哈哈~。。。什么缺陷呢?课上老师PPT中的那个例子不太好,并没有把核心体现出来,只是一部分,所以请结合课件和下面的例子仔细体会。设 S串 abcabdabcabcd ;P串 abcabcd好了,先求出P串的next[],(听... 阅读全文
posted @ 2014-11-07 19:33 闪光阳 阅读(3081) 评论(0) 推荐(0) 编辑
摘要: 在讲KMP之前请允许我回顾一下BF算法,那么什么叫BF算法呢?就是最普通的暴力,请见下方的代码 1 int return_pos(string S,string P) { 2 int i = 0,j = 0,k = 0; 3 int Slen = S.length(); 4 ... 阅读全文
posted @ 2014-11-07 19:32 闪光阳 阅读(511) 评论(1) 推荐(0) 编辑
摘要: link(http://en.wikipedia.org/wiki/Web_crawler)Web crawlerNot to be confused withoffline reader. For thesearch engineof the same name, seeWebCrawler.AW... 阅读全文
posted @ 2014-11-05 16:42 闪光阳 阅读(987) 评论(1) 推荐(0) 编辑
摘要: #include using namespace std;const int maxn = 1000;int f[maxn]={0};int n,e;int a[maxn][maxn]={0};void prim(int v0) { int cost[maxn]; for (int i=0;i> n >> e; for (int i=0;i> p >> q; cin >> a[p][q]; a[q][p]=a[p][q]; } prim(1);} 阅读全文
posted @ 2014-02-21 10:07 闪光阳 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 题目描述Xiao Ming is a 2013-BUCTer.This time he has a Programming Contest for 2013th.So he has a lot of things to do recently.Attending classes,doing homework,programing,playing etc.In order to do things more efficient,he makes a time schedule,which has a start time and a end time,but no time of durati. 阅读全文
posted @ 2014-02-20 21:13 闪光阳 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn = 10000; 4 int a[maxn][maxn]; 5 int v,e; 6 void prim(int v0) { 7 int flag[maxn] = {0}; 8 int pos; 9 flag[v0] = 1;10 for (int i = 0;i > v >> e;28 for (int i = 0;i > p >> q;30 cin >> a[p][q];31 a[q][p]=a[p][q];32 ... 阅读全文
posted @ 2014-02-20 20:30 闪光阳 阅读(256) 评论(0) 推荐(0) 编辑
摘要: //哈夫曼(最优二叉树)方法 建树//非指针做法//数据如果很大的话,有可能会超时#include #define maxn 10000+10000+3using namespace std;class T {public: int data,parent,left,right;}tree[maxn];int f[maxn] = {0};int search (int k) { int min1 = 99999999; int pos; for (int i = 0;i> n; for (int i=0; i> tree[i].data; } Huff... 阅读全文
posted @ 2014-02-20 19:17 闪光阳 阅读(429) 评论(0) 推荐(0) 编辑
摘要: //优先队列方法#include #include #define maxn 100005using namespace std;int main () { int n; long long ans = 0; int a[maxn],b[maxn]={0}; cin >> n; for (int i=0;i> a[i]; } sort (a,a+n); a[n] = 999999999; a[n+1] = 999999999; int fa=0,fb=0,ok,pos_b=0,sum; for (int i=0;i<n-1;i+... 阅读全文
posted @ 2014-02-20 10:50 闪光阳 阅读(415) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页