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

資源簡介

一種C語言字典樹創建和搜索的示例,可以創建一種無論增加多少單詞,搜索速度依然 = 該語言字母數 * 單詞長度 的效率的存儲結構。一個demo

資源截圖

代碼片段和文件信息

#include?“stdio.h“
#include?“stdlib.h“
#include????
#include????
#include?

/**************ChenJieZhu?created?at?20181030?18:00***********************/

typedef?struct?vocalUnit?VocalUnit;

struct?vocalUnit?{
char?isWord;?//如果深搜的時候發現是單詞的時候根據這個標記進行顯示?
char?c;??//同一層的鄰居字母?
struct?vocalUnit?*nextlayerHead;??//以本節點開始的下一層的首節點?
struct?vocalUnit?*nextBrother;?//保存的字母?
};

/**初始化節點**/
void?initDictTrees(VocalUnit*?unit)?{
unit->isWord?=?0;?
unit->nextBrother?=?NULL;?
unit->nextlayerHead?=?NULL;??
????unit->c?=?NULL;??
}

/**添加單詞到多叉樹**/
void?addWord(VocalUnit*?vHead?char*?word){
int?len?=?strlen(word);
int?i;
VocalUnit*?cursor?=?vHead;
for(i?=?0;?i? ????char?c?=?word[i];
????char?nextBrotherisEmpty?=?0;

評論

共有 條評論