WHAT DOES THIS DO!!???!!!
import java.io.*;
public class MisterRee
{
public static int[] answers = null;
public static boolean[] noRepeat = null;
public static void Mystery(int n)
{
answers = new int[n];
noRepeat = new boolean[n];
for (int i=0; i < n; i++)
{
noRepeat[i] = false;
}
permutation(0, n);
}
public static void mystery(int n, int N)
{
if (n < N) {
for (int i=0; i < N; i++)
if (!noRepeat[i])
{
noRepeat[i] = true;
answers[n] = i;
mystery(n + 1, N);
noRepeat[i] = false;
}
} else {
for (int i=0; i
System.out.print((answers[i] + 1) + " ");
System.out.println();
}
}
public Static void main(String args[])
{
Mystery(args[0]);
}
}
2007-12-22
03:24:41
·
3 answers
·
asked by
Computer Wiz
1