title: Finding anagrams for a given word
body: <p>Two words are anagrams if one of them has exactly same characters as that of the another word.</p>
  
  <p>Example : <code>Anagram</code> &amp; <code>Nagaram</code> are anagrams (case-insensitive).</p>
  
  <p>Now there are many questions similar to this . A couple of approaches to find whether two strings are anagrams are :</p>
  
  <p><strong>1)</strong> <code>Sort</code> the strings and compare them.</p>
  
  <p><strong>2)</strong> Create a <code>frequency map</code> for these strings and check if they are the same or not.</p>
  
  <p>But in this case , we are given with a word (for the sake of simplicity let us assume a single word only and it will have single word anagrams only) and we need to find anagrams for that. </p>
  
  <p>Solution which I have in mind is that , we can <strong>generate all permutations</strong> for the word and check which of these words <strong>exist in the dictionary</strong>  . But clearly , this is highly inefficient. Yes , the dictionary is available too.</p>
  
  <p>So what alternatives do we have here ?</p>
  
  <p>I also read in a similar thread that something can be done using <code>Tries</code> but the person didn't explain as to what the algorithm was and why did we use a Trie in first place , just an implementation was provided that too in Python or Ruby. So that wasn't really helpful which is why I have created this new thread. If someone wants to share their implementation (other than C,C++ or Java) then kindly explain it too.</p>