91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 640B
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-01-07
  • 標(biāo)簽: 字典樹??

資源簡介

用C語言實現(xiàn)的字典樹算法,用C語言實現(xiàn)的字典樹算法。

資源截圖

代碼片段和文件信息

#include
#include?
????????????????????//字典樹或者鍵樹?
#define?KIND?26;????//字母種類?

typedef?struct?node{
????int?count;//記錄遍歷到該節(jié)點形成的字符串出現(xiàn)的次數(shù)?
????struct?node*?next[KIND];?//指向兒子節(jié)點?
}trie;

int?init_trie(trie*&?T)
{
????int?i?=?0;
????T->count?=?1;
????for(;?i?????????T->next[i]?=?NULL;
}?

int?insert(trie*&?root?char*?word)?//插入?
{
????trie*?temp;
????int?i?=?0?branch?=?0;
????
????if(root?==?NULL)
????{
????????root?=?(trie*)malloc(sizeof(trie));
????????init_trie(root);
????}?
????
????temp?=?root;
????while(word[i]?!=?‘\0‘)
????{
????????branch?=?word[i]?-?‘a(chǎn)‘;
????????if(tem

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1336??2009-09-22?19:49??trie.cpp

-----------?---------??----------?-----??----

?????????????????1336????????????????????1


評論

共有 條評論