Skip to content

Instantly share code, notes, and snippets.

@jitsceait
Created May 4, 2014 05:54
Show Gist options
  • Select an option

  • Save jitsceait/63f97dc87c2e2095cc5b to your computer and use it in GitHub Desktop.

Select an option

Save jitsceait/63f97dc87c2e2095cc5b to your computer and use it in GitHub Desktop.
Trie initialization
#define MAX_SIZE 26
#define GET_CHAR_INDEX(ch)\
((int) ch - (int)'a' )
#define LEAF_NODE 1
#define true 1
#define false 0
typedef struct trie_node_t {
int value;
struct trie_node_t * children[MAX_SIZE];
}Node;
typedef struct trie{
int count ;
Node *root;
}trie;
void initialize(trie *t){
t->root = (Node *)malloc(sizeof(Node));
t->count =0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment