Skip to content

@daimajia 的 Trie #74

@icylogic

Description

@icylogic
void Query(Trie **trees,char* word){

    if (*word == '\0') {
        if ((*trees)->count > 0) {
            printf("存在\n");
        }else{
            printf("不存在\n");
        }
        return;
    }

    Trie **next = (*trees)->next;
    int distance = *word - 97;

    if (next[distance] != NULL) {
        return Query(&next[distance], word+1);
    }else{
        printf("单词不存在\n");
    }
}

返回值是 void, 还出现了 return Query()...这个没问题吗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions