/// <summary> /// We perform all permutations of data. /// </summary> /// <param name="data">The input data.</param> /// <returns></returns> public static List <T[]> Permutate <T>(T[] data) { // We find all permutations. List <T[]> res = new List <T[]>((int)Factorial.Eval((uint)data.Length)); Permutate(data.Clone() as T[], 0, res); return(res); }