delete a key in a trie To delete a key from a trie, there are four cases:

For the explanation of trie data structure, please check
the following link:
http://www.geeksforgeeks.org/trie-insert-and-search/

(1) Key is not in the trie. 

(2) Key present in the trie as a unique key. 

(3) Key is the prefix of another longer key. 

(4) Key presents in the trie, having at least one other key as prefix key.

The following code is my implementation of deleting a key from a trie.

struct trie_node
{
    int mark;
    struct trie_node* children[ALPHABET_SIZE];
};

struct trie
{
    struct trie_node* root;
    int count;  
};

// check if a trie node has no children
bool isFreeNode(struct trie_node* p)
{
    int i;
    for(i = 0; i &lt; ALPHABET_SIZE; ++i)
    {
        if(p-&gt;children[i])
            return false;
    }
    return true;
}

bool isLeafNode(struct trie_node* p)
{
    return p-&gt;mark == 1;
}

bool deleteHelper(struct trie_node* root, char* key, int level, int len)
{
    int ind;
    //check if the key is in the trie.
    if(root!=NULL)
    {
        if(level==len)
        {
            //check if the key is in the trie.
            if(root-&gt;mark==1)
            {
                root-&gt;mark = 0;

                //Is it an unique key?
                            if(isFreeNode(root))
                {
                    return true;
                }
                return false;
            }               
        }
        else
        {
            ind = *(key+level) - 'a';
            if(deleteHelper(root-&gt;children[ind], key, level+1, len))
            {
                free(root-&gt;children[ind]);
                root-&gt;children[ind] = NULL;

                //check if the node is an unique key node. Case (2) and
                            //and case (4) can both generates unique key node. 
                            if(!isLeafNode(root) &amp;&amp; isFreeNode(root))
                {
                    return true;
                }
                return false;
            }
        }
    }   
    return false;
}

void deleteKey(struct trie* trie, char* key)
{
    int len = strlen(key);
    if(len&gt;0)
    {
        //check if the key is the only one in the trie
            if(deleteHelper(trie-&gt;root, key, 0, len))
        {
            free(trie-&gt;root);
        }
    }
}
Check your indentation, mostly for comments. While there are a lots of indent styles for C, none of them recommends removing the spaces after if and for.
Using recursive functions is not the idiomatic way of doing things in C, but that's OK.
It's generally better to check for error conditions before, and handle the general case afterwards. This is a good idea because the "error condition" is generally smaller. For example, if you check for root == NULL case first, the reader doesn't have to remember that there is possibly an else branch. This will also force you to make return false cases more explicit in your if/else branches. I think it's a good thing.
You can write if (root-&gt;mark) instead of if(root-&gt;mark==1).
This code is too long:

// Is it an unique key?
if (isFreeNode(root))
{
    return true;
}
return false;


Simple write return isFreeNode(root);. Same thing for (!isLeafNode(root) &amp;&amp; isFreeNode(root))
*(key+level) should be written key[level].
You don't set trie-&gt;root to NULL after freeing it: this is not consistent with the earlier free().