我不断收到我的加载函数的段错误。 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