2013年8月21日

poj 1056 IMMEDIATE DECODABILITY 字典树

摘要: 题目链接:http://poj.org/problem?id=1056思路:字典树的简单应用,就是判断当前所有的单词中有木有一个是另一个的前缀,直接套用模板再在Tire定义中加一个bool类型的变量用来判断当前到达的位置是否构成另一个单词的编码代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int MAX=2; 8 class Trie 9 {10 public:11 bool isCode;12 Trie *next[MAX];13 };... 阅读全文

posted @ 2013-08-21 16:31 GyyZyp 阅读(117) 评论(0) 推荐(0) 编辑

导航