📄 permutations.java
字号:
{3,1,4,0,2},{3,1,4,0,5},{3,1,4,2,0},{3,1,4,2,5},{3,1,4,5,0},{3,1,4,5,2},{3,1,5,0,2},{3,1,5,0,4},{3,1,5,2,0},{3,1,5,2,4},{3,1,5,4,0},{3,1,5,4,2}, {3,2,0,1,4},{3,2,0,1,5},{3,2,0,4,1},{3,2,0,4,5},{3,2,0,5,1},{3,2,0,5,4},{3,2,1,0,4},{3,2,1,0,5},{3,2,1,4,0},{3,2,1,4,5},{3,2,1,5,0},{3,2,1,5,4}, {3,2,4,0,1},{3,2,4,0,5},{3,2,4,1,0},{3,2,4,1,5},{3,2,4,5,0},{3,2,4,5,1},{3,2,5,0,1},{3,2,5,0,4},{3,2,5,1,0},{3,2,5,1,4},{3,2,5,4,0},{3,2,5,4,1}, {3,4,0,1,2},{3,4,0,1,5},{3,4,0,2,1},{3,4,0,2,5},{3,4,0,5,1},{3,4,0,5,2},{3,4,1,0,2},{3,4,1,0,5},{3,4,1,2,0},{3,4,1,2,5},{3,4,1,5,0},{3,4,1,5,2}, {3,4,2,0,1},{3,4,2,0,5},{3,4,2,1,0},{3,4,2,1,5},{3,4,2,5,0},{3,4,2,5,1},{3,4,5,0,1},{3,4,5,0,2},{3,4,5,1,0},{3,4,5,1,2},{3,4,5,2,0},{3,4,5,2,1}, {3,5,0,1,2},{3,5,0,1,4},{3,5,0,2,1},{3,5,0,2,4},{3,5,0,4,1},{3,5,0,4,2},{3,5,1,0,2},{3,5,1,0,4},{3,5,1,2,0},{3,5,1,2,4},{3,5,1,4,0},{3,5,1,4,2}, {3,5,2,0,1},{3,5,2,0,4},{3,5,2,1,0},{3,5,2,1,4},{3,5,2,4,0},{3,5,2,4,1},{3,5,4,0,1},{3,5,4,0,2},{3,5,4,1,0},{3,5,4,1,2},{3,5,4,2,0},{3,5,4,2,1}, {4,0,1,2,3},{4,0,1,2,5},{4,0,1,3,2},{4,0,1,3,5},{4,0,1,5,2},{4,0,1,5,3},{4,0,2,1,3},{4,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,4},{5,2,3,1,4,0},{5,2,3,4,0,1},{5,2,3,4,1,0},{5,2,4,0,1,3},{5,2,4,0,3,1},{5,2,4,1,0,3},{5,2,4,1,3,0}, {5,2,4,3,0,1},{5,2,4,3,1,0},{5,3,0,1,2,4},{5,3,0,1,4,2},{5,3,0,2,1,4},{5,3,0,2,4,1},{5,3,0,4,1,2},{5,3,0,4,2,1},{5,3,1,0,2,4},{5,3,1,0,4,2}, {5,3,1,2,0,4},{5,3,1,2,4,0},{5,3,1,4,0,2},{5,3,1,4,2,0},{5,3,2,0,1,4},{5,3,2,0,4,1},{5,3,2,1,0,4},{5,3,2,1,4,0},{5,3,2,4,0,1},{5,3,2,4,1,0}, {5,3,4,0,1,2},{5,3,4,0,2,1},{5,3,4,1,0,2},{5,3,4,1,2,0},{5,3,4,2,0,1},{5,3,4,2,1,0},{5,4,0,1,2,3},{5,4,0,1,3,2},{5,4,0,2,1,3},{5,4,0,2,3,1}, {5,4,0,3,1,2},{5,4,0,3,2,1},{5,4,1,0,2,3},{5,4,1,0,3,2},{5,4,1,2,0,3},{5,4,1,2,3,0},{5,4,1,3,0,2},{5,4,1,3,2,0},{5,4,2,0,1,3},{5,4,2,0,3,1}, {5,4,2,1,0,3},{5,4,2,1,3,0},{5,4,2,3,0,1},{5,4,2,3,1,0},{5,4,3,0,1,2},{5,4,3,0,2,1},{5,4,3,1,0,2},{5,4,3,1,2,0},{5,4,3,2,0,1},{5,4,3,2,1,0} } } }; /** * Precomputed prefixes of given length of permutations of given length. * * Generates all length k prefixes of all permutations of {0,1,...,n-1} in lexicographic order. * Currently, 0 <= n <= 6. * * - If k == 0, an empty matrix is returned. * - Once calculated, permutation prefixes are kept across function calls. * - There are (n over k)k! = n!/(n-k)! prefixes of length k of permutations of n elements. * * @param k prefix length. * @param n permutation size. * @return all permutations of {0,1,..,n-1} as an array of arrays. */ public static int[][] prefixesPrecomputed(int k, int n) { try { return prefixPrecomp[n][k]; } catch(ArrayIndexOutOfBoundsException e) { throw new IllegalArgumentException(String.format("Unsupported argument (%s) for precomputed prefixes", e.getMessage())); } } /** All functionality is provided via static methods, so there is no need to construct objects of this type. */ public Permutations() {}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -