Import java.util.ArrayList;
Import Java.util.Arrays;
Import Java.util.HashSet;
Import Java.util.Iterator;
Import java.util.List;
Import Java.util.Set;
public class test{
Private static string[] s = new string[]{"A", "B", "a"};
private static int L = s.length;
private static set<string> Set = new hashset<string> ();
public static void Main (string[] args) {
List<string> Source = arrays.aslist (s);
list<string> target = new arraylist<string> ();
Sort (source,target);
Iterator<string> it = Set.iterator ();
while (It.hasnext ()) {
System.out.println (It.next ());
}
}
private static void sort (list<string> source, list<string> target) {
if (target.size () = = L) {
Set.add (Target.tostring (). ReplaceAll (",", ""). Replace ("[", "" "). Replace ("] "," ")
}
for (int i=0;i<source.size (); i++) {
list<string> targetlist = new arraylist<string> (target);
Targetlist.add (Source.get (i));
list<string> resourcelist = new arraylist<string> (source);
Resourcelist.remove (i);
Sort (resourcelist,targetlist);
}
}
}
Java recursive implementation of the full array improvement (a)---using hashset to achieve de-