Repeat Exercise P15.22, but use a queue instead.

Complete the following files:

PermutationGenerator.java

import java.util.List; public class PermutationGenerator { /** Gets all permutations of a given word. @param word a word not containing the character '+' @return a list containing all permutations of word */ public List<String> getPermutations(String word) { . . . } }

PermutationTester2.java

Use the following files:

PermutationDemo.java

import java.util.List;

public class PermutationDemo
{
   public static void main(String[] args)
   {
      PermutationGenerator gen = new PermutationGenerator();
      List<String> permutations = gen.getPermutations("meat");
      for (String perm : permutations)
         System.out.println(perm);
   }
}

PermutationTester.java

import java.util.List;

public class PermutationTester
{
   public static void main(String[] args)
   {
      PermutationGenerator gen = new PermutationGenerator();
      List<String> permutations = gen.getPermutations("meat");
      System.out.println(permutations.get(0));
      System.out.println("Expected: meat");
      System.out.println(permutations.get(1));
      System.out.println("Expected: meta");
      System.out.println(permutations.get(22));
      System.out.println("Expected: tame");
      System.out.println(permutations.get(23));     
      System.out.println("Expected: taem");
    }
}