我不斷收到我的加載函數的段錯誤。 bool load(const char *dictionary)
{
//create a trie data type
typedef struct node
{
bool is_word;
struct node *children[27]; //this is a pointer too!
我在Java中實現了Trie數據結構,但在運行代碼時沒有得到正確的答案。我使用一些簡單的字符串構建了trie。然後我搜索單詞和前綴,但結果不正確。我試過很多次,但仍然找不到可能出錯的地方。 Trie.java: public class Trie {
public class Vertex {
public int words;
public int prefi