trie.cpp
Node *Trie::insertOne(Node *root, int key, int num_child) {
    int index = key - root->key - 1;
    if (root->next[index] == NULL) {
        Node *node = newNode(key, num_child);
        root->next[index] = node;
    }
    return root->next[index];
}
/**
 * inserts a new node as a child at the specified index at a node if it is not present already
 * and returns the pointer to that node
 *
 * @param root parent node
 * @param key key at which child has to be inserted
 * @param num_child number of children to be present at the child node
 * @return pointer to the node at the specified index of the parent node
 */
inserts a new node as a child at the specified index at a node if it is not present already
and returns the pointer to that node

@param root parent node
@param key key at which child has to be inserted
@param num_child number of children to be present at the child node
@return pointer to the node at the specified index of the parent node
inserts a new node as a child at the specified index at a node if it is not present already and returns the pointer to that node @param root parent node @param key key at which child has to be inserted @param num_child number of children to be present at the child node @return pointer to the node at the specified index of the parent node
Node *Trie::insertOne(Node *root, int key, int num_child) {
    int index = key - root->key - 1;
    if (root->next[index] == NULL) {
        Node *node = newNode(key, num_child);
        root->next[index] = node;
    }
    return root->next[index];
}
Node * Trie :: insertOne ( Node * root , int key , int num_child ) { int index = key - root -> key - 1 ; if ( root -> next [ index ] == NULL ) { Node * node = newNode ( key , num_child ) ; root -> next [ index ] = node ; } return root -> next [ index ] ; }
inserts a new node as a child at the specified index at a node if it is not present already
 and returns the pointer to that node
inserts a new node as a child at the specified index at a node if it is not present already and returns the pointer to that node