2014年11月9日

排名算法

摘要: #include#includeusing namespace std;struct BinaryTree{ int count;// 该节点的孩子总数 int from_score; int to_score; BinaryTree* left; BinaryTree* right; Binary... 阅读全文

posted @ 2014-11-09 23:58 kangbry 阅读(130) 评论(0) 推荐(0) 编辑

kmp算法

摘要: kmp算法//计算偏移值void get_next(const char pat[], int next[]) { memset(next,0,sizeof(next)); int i=-1,j=0;next[0]=-1; while(j < strlen(pat)) { if(i==-1||pa... 阅读全文

posted @ 2014-11-09 00:39 kangbry 阅读(140) 评论(0) 推荐(0) 编辑

冒泡排序

摘要: void sort(int* a, int size){ for (int i = 0; i a[j]) { int t = a[j + 1 ]; a[j + 1] = a[j]; ... 阅读全文

posted @ 2014-11-09 00:22 kangbry 阅读(103) 评论(0) 推荐(0) 编辑

导航