The following program uses a Trie to build a dictonary for detecting Anagrams in the file with words (delimited by new lines)