Advertisement
Broatlas

trie_new

Apr 23rd, 2016
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. trie_node_t * trie_new(  void ){
  2.  
  3.     trie_node_t * tmp = NULL;
  4.     int i;
  5.  
  6.     if ( ( tmp = ( trie_node_t * ) malloc ( sizeof( trie_node_t ) ) ) == NULL )
  7.         return NULL;
  8.  
  9.     for( i = 0; i < ALPHA_SIZE; i++ ) {
  10.         tmp->child[ i ] = NULL;
  11.         tmp->end = 1;
  12.     }
  13.     return tmp;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement