trie.cpp
Node *Trie::newNode(int key, int num_child) {
    Node *node = (Node *) malloc(sizeof(node));
    node->key = key;
    node->num_child = num_child;
    node->next = (Node **) malloc(num_child * sizeof(Node *));
    for (int i = 0; i < num_child; i++) {
        node->next[i] = NULL;
    }
    return node;
}
/**
 * constructs a new node and returns its pointer
 *
 * @param key key of the new node
 * @param num_child number of children to be present in new node
 * @return pointer to the node that is created
 */
constructs a new node and returns its pointer
@param key key of the new node
@param num_child number of children to be present in new node
@return pointer to the node that is created
constructs a new node and returns its pointer @param key key of the new node @param num_child number of children to be present in new node @return pointer to the node that is created
Node *Trie::newNode(int key, int num_child) {
    Node *node = (Node *) malloc(sizeof(node));
    node->key = key;
    node->num_child = num_child;
    node->next = (Node **) malloc(num_child * sizeof(Node *));
    for (int i = 0; i < num_child; i++) {
        node->next[i] = NULL;
    }
    return node;
}
Node * Trie :: newNode ( int key , int num_child ) { Node * node = ( Node * ) malloc ( sizeof ( node ) ) ; node -> key = key ; node -> num_child = num_child ; node -> next = ( Node * * ) malloc ( num_child * sizeof ( Node * ) ) ; for ( int i = 0 ; i < num_child ; i ++ ) { node -> next [ i ] = NULL ; } return node ; }
constructs a new node and returns its pointer
 @param key key of the new node
 @param num_child number of children to be present in new node
 @return pointer to the node that is created
constructs a new node and returns its pointer @param key key of the new node @param num_child number of children to be present in new node @return pointer to the node that is created