Created
May 4, 2014 05:54
-
-
Save jitsceait/63f97dc87c2e2095cc5b to your computer and use it in GitHub Desktop.
Trie initialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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