trie/include/trie.h
2024-11-15 17:08:16 -06:00

16 lines
528 B
C

#ifndef TRIE_INCLUDED
#define TRIE_INCLUDED
#include <stdbool.h>
#include "vec.h"
typedef struct TrieNode TrieNode;
TrieNode *new_trie_node(void);
bool trie_insert(TrieNode **root, char *signedText);
bool trie_search(TrieNode *root, char *signedText);
TrieNode* find_node(TrieNode* root, char *signedText);
int collect_leaves(TrieNode *node, unsigned char *prefix, int len,Vec *v);
void print_trie_rec(TrieNode *node, unsigned char *prefix, int len);
void print_trie(TrieNode *node);
void free_trienode(TrieNode* node);
#endif