Trie implementation

Maybe you can just use "Map c"instead of "TrieNode[] c", that would allow you to use this for all the types of characters uppercase/lowercase and even special characters and even would save you space ( allocating 26 character array at each character level )


Your has function should probably look like this:

if (c[val]!=null && word.length()>1) {
    return c[val].has(word.substring(1)); //<-- Change is on this line
} else if (c[val].flag==true && word.length()==1) {
    ...etc

You perform the recursive call, but you really need to let that value propagate back out to the original caller.