(int[] permutation)
| 204 | } |
| 205 | |
| 206 | public static boolean permutationSign(int[] permutation) { |
| 207 | int nInversions = 0; |
| 208 | for (int i = 0; i < permutation.length; i++) { |
| 209 | for (int j = i + 1; j < permutation.length; j++) { |
| 210 | if (permutation[i] > permutation[j]) { |
| 211 | nInversions++; |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | return nInversions % 2 == 0; |
| 216 | } |
| 217 | |
| 218 | //pruning table |
| 219 | public static void createPrun(byte[] prunTable, int depth, short[][] moveTable, int times) { |