书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

随笔分类 -  C Trie

简单字典树练习
摘要:题目:http://acm.hdu.edu.cn/showproblem.php?pid=1251这个相当简单就不解释了。直接上代码。View Code #include "iostream"#include "cstdio"#include "cstring"#include "string"using namespace std;typedef struct node{ int Cross; struct node *next[26];}node;node *head;void InitHead(){ head 阅读全文

posted @ 2012-04-26 20:48 More study needed. 阅读(162) 评论(0) 推荐(0) 编辑

链表的典型应用——字典树
摘要:题目:http://acm.swust.edu.cn/oj/problem/842/这个题目是有一点复杂的,因为在存储内容的时候又再次用了链表。可以说它是链表题目的相当典型的例子了。还是直接上代码吧。View Code #include "iostream"#include "cstring"#include "string"#include "cstdio"#include "algorithm"#include "malloc.h"using namespace std; 阅读全文

posted @ 2012-04-26 20:08 More study needed. 阅读(261) 评论(0) 推荐(0) 编辑

Trie解决POJ 2503
摘要:题目:http://poj.org/problem?id=2503就是一个字典树的简单应用, 不解释。View Code #include "iostream"using namespace std;typedef struct node{ char word[21]; int mark; struct node * next[26];}node;node * root;void InitRoot(){ root = new node(); root->mark=0; memset(root->next, NULL, sizeof(root->next)) 阅读全文

posted @ 2011-10-02 17:10 More study needed. 阅读(277) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

书山有径勤为路>>>>>>>>

<<<<<<<<学海无涯苦作舟!

点击右上角即可分享
微信分享提示