コード例 #1
0
 @Test
 public void testSolveNQueens3() {
   ArrayList<String[]> result = s.solveNQueens(4);
   for (String[] sa : result) {
     System.out.println(Arrays.asList(sa));
   }
   assertNotNull(result);
   assertTrue(result.size() == 2);
 }
コード例 #2
0
 @Test
 public void testSolveNQueens4() {
   ArrayList<String[]> result = s.solveNQueens(9);
   for (String[] sa : result) {
     System.out.println(Arrays.asList(sa));
   }
   assertNotNull(result);
   assertTrue("number of distinct solutions " + result.size(), result.size() == 352);
 }
コード例 #3
0
 @Test
 public void testSolveNQueens1() {
   ArrayList<String[]> result = s.solveNQueens(0);
   assertNotNull(result);
   assertTrue(result.size() == 0);
 }