All pastes #750668 Raw Edit

Something

public java v1 · immutable
#750668 ·published 2007-10-26 18:10 UTC
rendered paste body
package crackers;import analysers.Length;public class Permutation {	/**	 * @param args	 */	public static void main(String[] args) {		// TODO Auto-generated method stub		String ct = "thequickbrownfoxjumpsoverthelazydog";		doKeys(11);	}		public static int[] key;		public static void doKeys(int length) {		int[] space = new int[length];		key = new int[length];		for(int i = 0; i < length; i++) {			space[i] = i;		}		permutate(0, space);	}		public static void permutate(int position, int[] left) {		if(position < key.length) {			int[] newLeft = new int[left.length - 1];			for(int i = 0; i < left.length; i++) {				key[position] = left[i];				int k = 0;				for(int j = 0; j < newLeft.length; j++) {					if(k == i) k++;					newLeft[j] = left[k];					k++;				}				permutate(position + 1, newLeft);			}		}		else {			for(int i = 0; i < key.length; i++) {				System.out.print(key[i]);			}			System.out.println();		}	}}