C Trie
c\ntypedef struct node {\n    bool end;\n    struct node *children[26];\n} Node;\n\nint cmp(const void *a, const void *b) {\n    return strcmp(*(const char **)a
```c\ntypedef struct node {\n    bool end;\n    struct node *children[26];\n} Node;\n\nint cmp(const void *a, const void *b) {\n    return strcmp(*(const char **)a, *(const char **)b);\n}\n\nchar *longestWord(char **words, int wordsSize) {\n    qsort(words, wordsSize, sizeof(words[0]), cmp);\n    Node *trie = malloc(sizeof(Node));\n    for (int i = 0; i < 26; i++) trie->children[i] = NULL;\n    int max = 0, index = 0;\n    for (int i = 0; i < wordsSize; i++) {\n        Node *next = trie;\n        int temp = 0, len = strlen(words[i]);\n        for (int j = 0; j < len; j++) {\n            Node *n;\n            if (next->children[words[i][j] - \'a\'] == NULL) {\n                n = malloc(sizeof(Node));\n                for (int i = 0; i < 26; i++) n->children[i] = NULL;\n                n->end = false;\n            } else {\n                n = next->children[words[i][j] - \'a\'];\n            }\n            if (j == len - 1) n->end = true;\n            if (n->end == false) break;\n            next = next->children[words[i][j] - \'a\'] = n;\n            if (next->end == true) temp++;\n            if (j == len - 1 && temp > max) {\n                max = temp;\n                index = i;\n            }\n        }\n    }\n    return words[index];\n}\n```
['Trie', 'C']