here i have a dictionary with the words and i have to find thewords with the largest size, (i mean word count for egabdominohysterectomy) which have anagrams , like for example ,loop-> pool. Also , i have to sort them in alphabetical way so whatcould be the algorithm for that
public class Anagrams {
  private static final int MAX_WORD_LENGTH = 25;
  private static IArray>theDictionaries =
     newArray<>(MAX_WORD_LENGTH);
  public static void main(String... args) {
     initTheDictionaies();
     process();
  }
  private static void process() {
//start here
     if (isAnagram(\"pool\", \"loop\")){              // REMOVE
        System.out.println(\"ANAGRAM!\");              //REMOVE
    Â
//above this
  }
 Â
  private static boolean isAnagram(String word1, Stringword2) {
     boolean b = false;
     if(getWordSorted(word1).equals(getWordSorted(word2))) {
        b = true;
     }
     return b;
  }
  private static String getWordSorted(String word){
     ISortedListsortedLetters = new SortedList<>();
     StringBuilder sb = newStringBuilder();
     for (int i = 0; i         sortedLetters.add(word.charAt(i));
     }
     for (Character c : sortedLetters){
        sb.append(c);
     }
     String sortedWord =sb.toString();
     return sortedWord;
  }
  private static void initTheDictionaies() {
     String s;
     for (int i = 0; i         theDictionaries.set(i, new Vector());
     }
     try (
        BufferedReaderbr = new BufferedReader(
           new FileReader(\"data/pocket.dic\")
        )
     ) {
        while ((s =br.readLine()) != null) {
           theDictionaries.get(s.length()).pushBack(s);
        }
     } catch (Exception ex) {
        ex.printStackTrace();
        System.exit(-1);
     }
     for (int i = 0; i         theDictionaries.get(i).shrinkToFit();
     }
  }
}